酒吧房加测试代码判断

This commit is contained in:
2026-01-16 09:00:55 +08:00
parent 54abef6b56
commit 9bec4ef093
4 changed files with 10 additions and 3 deletions

View File

@@ -1177,7 +1177,6 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
// 批量更新库存
ksort($inventory_updates); // 按ID排序
foreach ($inventory_updates as $detail_id => $count) {
Db::name('vs_gift_bag_detail')->where('id',$detail_id)->lock(true)->find(); // 先查并加锁
$result = db::name("vs_gift_bag_detail")
->where('id',$detail_id)
->where('remaining_number', '>=', $count) // 确保库存充足