Commit d7d10542 authored by lixiaofang's avatar lixiaofang

add

parent 294351f1
...@@ -295,24 +295,21 @@ def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10, sort_type=PICTORIAL ...@@ -295,24 +295,21 @@ def pictorial_topic_sort(pictorial_id=-1, offset=0, size=10, sort_type=PICTORIAL
:return: :return:
""" """
try: try:
days1 = 0
days2 = 0 days2 = 0
if sort_type == PICTORIAL_TOPIC_SORT.DAY_HOT: if sort_type == PICTORIAL_TOPIC_SORT.DAY_HOT:
days1 = 1
days2 = 1 days2 = 1
if sort_type == PICTORIAL_TOPIC_SORT.WEEK_HOT: if sort_type == PICTORIAL_TOPIC_SORT.WEEK_HOT:
days1 = 1
days2 = 7 days2 = 7
if sort_type == PICTORIAL_TOPIC_SORT.MOUTH_HOT: if sort_type == PICTORIAL_TOPIC_SORT.MOUTH_HOT:
days1 = 1
days2 = 30 days2 = 30
now = datetime.datetime.now() now = datetime.datetime.now()
yesterday1 = now - datetime.timedelta(days=days1)
yesterday2 = now - datetime.timedelta(days=days2) yesterday2 = now - datetime.timedelta(days=days2)
yesterday_begin_time = "%s-%s-%s 00:00:00" % (yesterday2.year, yesterday2.month, yesterday2.day) yesterday_begin_time = "%s-%s-%s %s:%s:%s" % (
yesterday_end_time = "%s-%s-%s 23:59:59" % (yesterday1.year, yesterday1.month, yesterday1.day) yesterday2.year, yesterday2.month, yesterday2.day, yesterday2.hour, yesterday2.minute, yesterday2.second)
yesterday_end_time = "%s-%s-%s %s:%s:%s" % (
now.year, now.month, now.day, now.hour, now.minute, now.second)
logging.info("get yesterday_begin_time:%s" % yesterday_begin_time) logging.info("get yesterday_begin_time:%s" % yesterday_begin_time)
logging.info("get yesterday_end_time:%s" % yesterday_end_time) logging.info("get yesterday_end_time:%s" % yesterday_end_time)
......
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