diff --git a/bi/vas_yoy_flow.py b/bi/vas_yoy_flow.py index 8f93112..1a51490 100644 --- a/bi/vas_yoy_flow.py +++ b/bi/vas_yoy_flow.py @@ -26,7 +26,7 @@ class S: return 0 def get_flow(self, st, et): - sql = '''select sum(pay_amount) flow from vas_order where ct>={} and ct<{}'''.format(st, et) + sql = '''select sum(pay_amount) flow from vas_order where ct>={} and ct<{} and order_status in (1,2);'''.format(st, et) rows = self.mysql_db_vas.query(sql) if len(rows) > 0: return safe_get_int(rows[0], "flow") @@ -37,6 +37,8 @@ class S: zero_time = get_today_zero_time() - 86400 last_time = self.get_last_ptime() + last_time = get_today_zero_time() - 86400 + while last_time <= get_today_zero_time(): next_time = last_time + 300 flow = self.get_flow(zero_time, next_time)