This commit is contained in:
lwl0608 2024-05-08 19:41:59 +08:00
parent 1d8ef42277
commit 36ee501e3b
1 changed files with 6 additions and 6 deletions

View File

@ -43,20 +43,20 @@ class S:
dt = datetime.datetime.fromtimestamp(t)
formatted_dt = dt.strftime('%Y-%m-%d 00:00:00')
sql_q = "select pdate from vas_day_flow where pdate='{}'".format(get_time_str_by_ts(t))
sql_q = "select * from vas_day_flow where pdate='{}'".format(get_time_str_by_ts(t))
rows = self.mysql_db_bi.query(sql_q)
if len(rows) > 0:
print(rows)
sql_u = "update set vas_day_flow set flow=%s where pdate='{}'".format(get_time_str_by_ts(t))
return self.mysql_db_bi.exec(sql_u, flow)
else:
print(0)
# sql = '''update vas_day_flow set flow=%s where ptime=%s'''
# return self.mysql_db_bi.exec(sql, (flow, formatted_dt))
sql_i = "insert into vas_day_flow (pdate, flow) values (%s,%s)"
return self.mysql_db_bi.exec(sql_i, (formatted_dt, flow))
def proc(self):
zero_time = get_today_zero_time()
last_time = self.get_last_ptime()
self.update_day_flow(1)
self.update_day_flow(999)
while last_time <= int(time.time()):
next_time = last_time + 300