sql=f'SELECT uuid,a.reference_type,a.reference_number,FROM_UNIXTIME(a.create_time,"%Y-%c-%d %h:%i:%s") as payment_time,a.amount_type FROM assets_log_{now_month} as a where {query} ORDER BY id desc limit {(int(page) - 1) * size},{size}'
sql=f'SELECT uuid,amount,a.reference_type,a.reference_number,FROM_UNIXTIME(a.create_time,"%Y-%c-%d %h:%i:%s") as payment_time,a.amount_type FROM assets_log_{now_month} as a where {query} ORDER BY id desc limit {(int(page) - 1) * size},{size}'
once_res=self.linkmysql.query_mysql(sql)
once_res=self.linkmysql.query_mysql(sql)
money_sql=f"SELECT sum(amount) FROM assets_log_{now_month} where {query} "
money_sql=f"SELECT sum(amount) FROM assets_log_{now_month} where {query} "
count_sql=f"SELECT count(*) FROM `payment_log` where {' and '.join(query)}"
count_sql=f"SELECT count(*) FROM `payment_log` where {' and '.join(query)}"
list_sql=f"SELECT money,cont,url,FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') as create_time FROM `payment_log` where {' and '.join(query)} ORDER BY id desc limit {(int(page) - 1) * page},{size} "
list_sql=f"SELECT money,cont,url,FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') as create_time FROM `payment_log` where {' and '.join(query)} ORDER BY id desc limit {(int(page) - 1) * size},{size} "
else:
else:
count_sql=f"SELECT count(*) FROM `payment_log`"
count_sql=f"SELECT count(*) FROM `payment_log`"
list_sql=f"SELECT money,cont,url,FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') as create_time FROM `payment_log` ORDER BY id desc limit {(int(page) - 1) * page},{size} "
list_sql=f"SELECT money,cont,url,FROM_UNIXTIME(create_time,'%Y-%c-%d %h:%i:%s') as create_time FROM `payment_log` ORDER BY id desc limit {(int(page) - 1) * size},{size} "