上线代码修改
This commit is contained in:
@@ -345,14 +345,14 @@ class BlindBoxTurntableGiftDrawWorld extends Model
|
||||
'draw_times' => $totalDrawTimes,
|
||||
'periods' => $periods,
|
||||
];
|
||||
$precomputedResultss[] = [
|
||||
'gift_user_id' => $giftUserId,
|
||||
'gift_bag_detail' => $selectedGift,
|
||||
'gift' => $gift,
|
||||
'draw_times' => $totalDrawTimes,
|
||||
'periods' => $periods,
|
||||
];
|
||||
$totalDrawTimes++;
|
||||
// $precomputedResultss[] = [
|
||||
// 'gift_user_id' => $giftUserId,
|
||||
// 'gift_bag_detail' => $selectedGift,
|
||||
// 'gift' => $gift,
|
||||
// 'draw_times' => $totalDrawTimes,
|
||||
// 'periods' => $periods,
|
||||
// ];
|
||||
// $totalDrawTimes++;
|
||||
$currentXlhPeriodsNum++;
|
||||
$addcurrentXlhPeriodsNum++;
|
||||
|
||||
@@ -361,6 +361,7 @@ class BlindBoxTurntableGiftDrawWorld extends Model
|
||||
}
|
||||
}
|
||||
}
|
||||
$totalDrawTimes = 0;
|
||||
}
|
||||
|
||||
// 再从新奖池中分配剩余所需礼物
|
||||
@@ -581,6 +582,16 @@ class BlindBoxTurntableGiftDrawWorld extends Model
|
||||
|
||||
// 批量更新
|
||||
foreach ($inventoryUpdates as $giftId => $count) {
|
||||
$giftBagDetail = Db::name("vs_gift_bag_detail")
|
||||
->where('id', $giftId)
|
||||
->find();
|
||||
if (!$giftBagDetail) {
|
||||
throw new \Exception("礼物详情不存在,ID: " . $giftId);
|
||||
}
|
||||
// 检查库存是否足够
|
||||
if ($giftBagDetail['remaining_number'] < $count) {
|
||||
throw new \Exception("礼物库存不足,ID: " . $giftId);
|
||||
}
|
||||
$ret = db::name("vs_gift_bag_detail")->where('id',$giftId)
|
||||
->setDec('remaining_number', $count);
|
||||
if (!$ret) {
|
||||
|
||||
Reference in New Issue
Block a user