获取所有事件
This commit is contained in:
parent
f8b2b6ce77
commit
af004e941c
@ -106,7 +106,10 @@ async def my_event(request: Request,
|
||||
) -> schemas.Msg:
|
||||
"""获取自己的事件权限"""
|
||||
event_list = []
|
||||
my_data_auth = await ck.distinct(game, 'event', '#event_name')
|
||||
# start_date = (datetime.datetime.now()-datetime.timedelta(days=30)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
# where = f"""`#event_time` > '{start_date}'"""
|
||||
# my_data_auth = await ck.distinct(game, 'event', '#event_name',where)
|
||||
my_data_auth = await rdb.smembers(f'{game}_event_set')
|
||||
|
||||
#
|
||||
# else:
|
||||
|
@ -53,8 +53,8 @@ class CKDrive:
|
||||
res = await self.execute(sql)
|
||||
return res[0]['count']
|
||||
|
||||
async def distinct(self, db: str, tb: str, field: str):
|
||||
sql = f'select distinct `{field}` as v from {db}.{tb}'
|
||||
async def distinct(self, db: str, tb: str, field: str, where: str = '1'):
|
||||
sql = f'select distinct `{field}` as v from {db}.{tb} where {where}'
|
||||
res = await self.query_dataframe(sql)
|
||||
return res['v'].to_list()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user