解决超出发放礼物问题-盲盒转盘
This commit is contained in:
@@ -202,7 +202,7 @@ class BlindBoxTurntableGiftDraw extends Model
|
|||||||
if (empty($availableGifts)) {
|
if (empty($availableGifts)) {
|
||||||
$availableGifts = $this->resetPoolAndReload($bag_data['id'], $room_id, $periods + 1, 0);
|
$availableGifts = $this->resetPoolAndReload($bag_data['id'], $room_id, $periods + 1, 0);
|
||||||
if (empty($availableGifts)) {
|
if (empty($availableGifts)) {
|
||||||
return ['code' => 0, 'msg' => '重置奖池后仍无可用礼物', 'data' => null];
|
throw new \Exception('重置奖池后仍无可用礼物');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ class BlindBoxTurntableGiftDraw extends Model
|
|||||||
$remaining_available_gifts = $availableGifts;
|
$remaining_available_gifts = $availableGifts;
|
||||||
$availableGifts = $this->resetPoolAndReload($bag_data['id'], $room_id, $periods + 1, 0);
|
$availableGifts = $this->resetPoolAndReload($bag_data['id'], $room_id, $periods + 1, 0);
|
||||||
if (empty($availableGifts)) {
|
if (empty($availableGifts)) {
|
||||||
return ['code' => 0, 'msg' => '重置奖池后仍无可用礼物', 'data' => null];
|
throw new \Exception('重置奖池后仍无可用礼物');
|
||||||
}
|
}
|
||||||
$totalDrawTimes = 0;
|
$totalDrawTimes = 0;
|
||||||
// 不要修改$num的值,保持原始请求数量
|
// 不要修改$num的值,保持原始请求数量
|
||||||
@@ -237,7 +237,7 @@ class BlindBoxTurntableGiftDraw extends Model
|
|||||||
$remaining_available_gifts
|
$remaining_available_gifts
|
||||||
);
|
);
|
||||||
if (empty($precomputedResults['precomputedResults'])) {
|
if (empty($precomputedResults['precomputedResults'])) {
|
||||||
return ['code' => 0, 'msg' => '预计算抽奖结果失败', 'data' => null];
|
throw new \Exception('预计算抽奖结果失败');
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user