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