完成虎牙宝典WSS绑定与快照隔离重构
This commit is contained in:
@@ -310,10 +310,15 @@ class RechargeMixin:
|
||||
}
|
||||
goods.append(item)
|
||||
|
||||
worker_db.query(HuyaRechargeGoodsSnapshot).delete(synchronize_session=False)
|
||||
worker_db.query(HuyaRechargeGoodsSnapshot).filter(
|
||||
HuyaRechargeGoodsSnapshot.account_id == account.id,
|
||||
HuyaRechargeGoodsSnapshot.sid == (self._to_int(config_info.get("sid")) or 2203),
|
||||
).delete(synchronize_session=False)
|
||||
for item in goods:
|
||||
worker_db.add(
|
||||
HuyaRechargeGoodsSnapshot(
|
||||
account_id=account.id,
|
||||
sid=self._to_int(config_info.get("sid")) or 2203,
|
||||
spu_id=item["spu_id"],
|
||||
sku_id=item["sku_id"],
|
||||
name=item["name"],
|
||||
@@ -382,7 +387,11 @@ class RechargeMixin:
|
||||
|
||||
snapshot = (
|
||||
worker_db.query(HuyaRechargeGoodsSnapshot)
|
||||
.filter(HuyaRechargeGoodsSnapshot.spu_id == spu_id)
|
||||
.filter(
|
||||
HuyaRechargeGoodsSnapshot.account_id == account.id,
|
||||
HuyaRechargeGoodsSnapshot.sid == (self._to_int(config_info.get("sid")) or 2203),
|
||||
HuyaRechargeGoodsSnapshot.spu_id == spu_id,
|
||||
)
|
||||
.first()
|
||||
)
|
||||
payload_sku_id = self._to_int(self.payload.get("sku_id"))
|
||||
|
||||
Reference in New Issue
Block a user