1.修复部分功能因没传label_id而报错的问题

This commit is contained in:
李伟 2022-05-23 15:38:59 +08:00
parent 79a1b0c559
commit d98a9f51a0

View File

@ -679,7 +679,7 @@ ORDER BY level
.where(and_(*where)) \ .where(and_(*where)) \
.group_by(event_date_col,e_account_id_col) .group_by(event_date_col,e_account_id_col)
sql = str(qry.compile(compile_kwargs={"literal_binds": True})) sql = str(qry.compile(compile_kwargs={"literal_binds": True}))
columnName = event['label_id'] columnName = event.get('label_id','')
if columnName != '': if columnName != '':
sql = sql.replace('SELECT', f'SELECT {columnName},', 1) sql = sql.replace('SELECT', f'SELECT {columnName},', 1)
sql += f',{columnName}' sql += f',{columnName}'