This commit is contained in:
lwl0608 2024-09-13 18:26:32 +08:00
parent f71a76f567
commit 7affc2d940
1 changed files with 3 additions and 2 deletions

View File

@ -44,6 +44,7 @@ class S:
sql = "SELECT mid, SUM(`change`) AS income FROM `vas_ch_income` WHERE mid>0 AND ct>={} AND ct<{} GROUP BY mid".format(st, et)
rows = self.mysql_db_vas.query(sql)
print("len(rows): {}".format(len(rows)))
sort_dict_list(rows, "income", desc=True)
dt = datetime.datetime.fromtimestamp(st)
formatted_dt = dt.strftime('%Y-%m-%d 00:00:00')
@ -56,8 +57,8 @@ class S:
income = safe_get_int(row, "income")
sql_q = "select * from vas_cur_streamer_income where mid={} and pdate='{}'".format(mid, formatted_dt)
rows = self.mysql_db_bi.query(sql_q)
if len(rows) > 0:
rows_bi = self.mysql_db_bi.query(sql_q)
if len(rows_bi) > 0:
sql_u = "update vas_cur_streamer_income set income=%s where mid=%s and pdate=%s"
self.mysql_db_bi.exec(sql_u, (income, mid, formatted_dt))
else: