秘地bug修改-盲盒转盘
This commit is contained in:
@@ -291,6 +291,12 @@ class BlindBoxTurntableGift extends Model
|
||||
$gift_bag_detail = $result['gift_bag_detail'];
|
||||
$gift = $result['gift'];
|
||||
|
||||
$pan_data = db::name("vs_room_pan")
|
||||
->where(['room_id'=>$room_id,'gift_bag_detail_id'=>$gift_bag_detail['id']])->value("remaining_number");
|
||||
if($pan_data < 1){
|
||||
db::rollback();
|
||||
return ['code' => 0, 'msg' => '礼物数量不足', 'data' => null];
|
||||
}
|
||||
// 构造返回数据
|
||||
$result_data = [
|
||||
'user_id' => $user_id,
|
||||
@@ -345,7 +351,7 @@ class BlindBoxTurntableGift extends Model
|
||||
|
||||
// 减去盲盒包礼物数量
|
||||
$ret = db::name("vs_room_pan")
|
||||
->where(['room_id'=>$room_id,'gift_bag_detail_id'=>$gift_bag_detail['id']])
|
||||
->where(['room_id'=>$room_id,'gift_bag_detail_id'=>$gift_bag_detail['id'],"remaining_number"=>["<>",0]])
|
||||
->setDec('remaining_number',1);
|
||||
|
||||
if(!$ret){
|
||||
@@ -355,10 +361,10 @@ class BlindBoxTurntableGift extends Model
|
||||
}
|
||||
|
||||
// 处理奖池重置操作
|
||||
if ($should_reset_all_gifts) {
|
||||
// 重置奖池中所有礼物数量
|
||||
$this->reset_gift_pool($room_id, $gift_bag_id, $current_periods);
|
||||
}
|
||||
// if ($should_reset_all_gifts) {
|
||||
// // 重置奖池中所有礼物数量
|
||||
// $this->reset_gift_pool($room_id, $gift_bag_id, $current_periods);
|
||||
// }
|
||||
|
||||
// 批量插入盲盒转盘结果记录
|
||||
foreach ($gift_user_counts as $user_gift) {
|
||||
|
||||
Reference in New Issue
Block a user