add bi
This commit is contained in:
parent
c7d34d61b4
commit
df4b88f9c0
|
@ -1,4 +1,5 @@
|
|||
from lib.all import *
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
# 流水同比
|
||||
|
@ -20,8 +21,9 @@ class S:
|
|||
sql = '''select * from vas_yoy_flow order by ptime desc limit 1'''
|
||||
rows = self.mysql_db_bi.query(sql)
|
||||
if len(rows) > 0:
|
||||
return rows[0].get("ptime")
|
||||
return ""
|
||||
dt = rows[0].get("ptime")
|
||||
return dt.timestamp()
|
||||
return 0
|
||||
|
||||
def get_flow(self, st, et):
|
||||
sql = '''select sum(pay_amount) flow from vas_order where ct>={} and ct<{}'''.format(st, et)
|
||||
|
@ -33,6 +35,8 @@ class S:
|
|||
def proc(self):
|
||||
zero_time = get_today_zero_time() - 86400
|
||||
last_ptime = self.get_last_ptime()
|
||||
if last_ptime == 0:
|
||||
return
|
||||
|
||||
print(zero_time)
|
||||
print(last_ptime, type(last_ptime))
|
||||
|
|
|
@ -254,5 +254,3 @@ def dict2json(dic):
|
|||
if not isinstance(dic, dict):
|
||||
return json.dumps({})
|
||||
return json.dumps(dic, ensure_ascii=False)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue