fix flow calc
This commit is contained in:
parent
dc6fa92acf
commit
728360a3cc
|
@ -24,9 +24,18 @@ class S:
|
|||
et = st + 86400
|
||||
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)
|
||||
flow = 0
|
||||
if len(rows) > 0:
|
||||
return safe_get_int(rows[0], "flow")
|
||||
return 0
|
||||
flow = safe_get_int(rows[0], "flow")
|
||||
|
||||
sql_except = '''select sum(pay_amount) flow from vas_order where ct>={} and ct<{} and order_status in (1,2) product_id in ('outer_raven');'''.format(st, et)
|
||||
rows_except = self.mysql_db_vas.query(sql_except)
|
||||
flow_except = 0
|
||||
if len(rows_except) > 0:
|
||||
flow_except = safe_get_int(rows_except[0], "flow")
|
||||
print("flow: {}, flow_except: {}".format(flow, flow_except))
|
||||
|
||||
return flow - flow_except
|
||||
|
||||
def update_day_flow(self, flow):
|
||||
t = get_today_zero_time()
|
||||
|
|
Loading…
Reference in New Issue