Commit acea2601 authored by lixiaofang's avatar lixiaofang

修改bug

parent b86c40fb
...@@ -91,9 +91,10 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty ...@@ -91,9 +91,10 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty
return [] return []
def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', action_type=None, content_level=0, def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', content_level=0,
content_day_need_add_one_day=False): content_day_need_add_one_day=False, action_type=None):
try: try:
if num_days == None: if num_days == None:
return [] return []
##比较当前时间和最后一次创建时间的差 ##比较当前时间和最后一次创建时间的差
...@@ -153,7 +154,7 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type ...@@ -153,7 +154,7 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
# nowt = now.strftime('%Y-%m-%d %H:%M:%S') # nowt = now.strftime('%Y-%m-%d %H:%M:%S')
##获取创建时间和当前时间的相差秒数 ##获取创建时间和当前时间的相差秒数
# num = (now - createt).total_seconds() # num = (now - createt).total_seconds()
num_days = now.day - createt.day num_days = (now - createt).days
content_day_need_add_one_day = False content_day_need_add_one_day = False
if after_day == True and card_info is not None: if after_day == True and card_info is not None:
num_days += repeat_time num_days += repeat_time
...@@ -176,7 +177,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type ...@@ -176,7 +177,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
elif num_days > 6 and num_days <= 365: elif num_days > 6 and num_days <= 365:
get_time = get_ten_last_days_random_time(num_days=num_days, content_level=content_level, get_time = get_ten_last_days_random_time(num_days=num_days, content_level=content_level,
content_day_need_add_one_day=content_day_need_add_one_day) content_day_need_add_one_day=content_day_need_add_one_day,
action_type=action_type)
time_region = 2 time_region = 2
return get_time, time_region return get_time, time_region
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment