mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update setu.py
This commit is contained in:
parent
8ac440335e
commit
00b674cebb
@ -94,7 +94,7 @@ class Setu(db.Model):
|
|||||||
flag = False if r18 == 0 else True
|
flag = False if r18 == 0 else True
|
||||||
setattr(Setu, 'count', db.func.count(cls.local_id).label('count'))
|
setattr(Setu, 'count', db.func.count(cls.local_id).label('count'))
|
||||||
count = await cls.select('count').where(cls.is_r18 == flag).gino.first()
|
count = await cls.select('count').where(cls.is_r18 == flag).gino.first()
|
||||||
return count
|
return count[0]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def get_image_in_hash(cls, img_hash: str) -> "Setu":
|
async def get_image_in_hash(cls, img_hash: str) -> "Setu":
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user