mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update russian_user.py
This commit is contained in:
parent
5090afc35b
commit
61034a5629
@ -53,7 +53,7 @@ class RussianUser(db.Model):
|
|||||||
try:
|
try:
|
||||||
user = await cls.query.where(
|
user = await cls.query.where(
|
||||||
(cls.user_qq == user_qq) & (cls.group_id == group_id)
|
(cls.user_qq == user_qq) & (cls.group_id == group_id)
|
||||||
).gino.first()
|
).with_for_update().gino.first()
|
||||||
if not user:
|
if not user:
|
||||||
user = await cls.create(
|
user = await cls.create(
|
||||||
user_qq=user_qq,
|
user_qq=user_qq,
|
||||||
@ -66,7 +66,7 @@ class RussianUser(db.Model):
|
|||||||
elif itype == 'lose':
|
elif itype == 'lose':
|
||||||
await user.update(
|
await user.update(
|
||||||
lose_money=user.lose_money + count,
|
lose_money=user.lose_money + count,
|
||||||
).with_for_update().apply()
|
).apply()
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user