盲盒转盘 优化 提交

This commit is contained in:
2025-10-29 09:26:57 +08:00
parent 5df6ffa870
commit d09bb36ad7
4 changed files with 1324 additions and 14 deletions

View File

@@ -72,7 +72,9 @@ class User extends adminApi
if($v=='coin1'){ if($v=='coin1'){
$where['c.coin'] = ['>=',$input_data]; $where['c.coin'] = ['>=',$input_data];
}elseif($v=='coin2'){ }elseif($v=='coin2'){
if($input_data){
$where['c.coin'] = ['<=',$input_data]; $where['c.coin'] = ['<=',$input_data];
}
}elseif($v=='createtime'){ }elseif($v=='createtime'){
$where['a.createtime'] = ['>=',strtotime($input_data)]; $where['a.createtime'] = ['>=',strtotime($input_data)];
$where['a.createtime'] = ['<=',strtotime($input_data)]; $where['a.createtime'] = ['<=',strtotime($input_data)];

View File

@@ -40,7 +40,7 @@ class BlindBoxTurntable extends BaseCom
$num = input('num',1); $num = input('num',1);
$heart_id = input('heart_id',0); $heart_id = input('heart_id',0);
$auction_id = input('auction_id',0); $auction_id = input('auction_id',0);
$reslut = model('BlindBoxTurntableGiftDrawWorld')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id,$heart_id,$auction_id); $reslut = model('BlindBoxTurntableGiftDrawWorldNew')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id,$heart_id,$auction_id);
return v($reslut['code'], $reslut['msg'], $reslut['data']); return v($reslut['code'], $reslut['msg'], $reslut['data']);
} }
/* /*
@@ -93,7 +93,7 @@ class BlindBoxTurntable extends BaseCom
$user_id = $this->uid; $user_id = $this->uid;
$room_id = input('room_id',0); $room_id = input('room_id',0);
$num = input('num',1); $num = input('num',1);
$reslut = model('BlindBoxTurntableGiftDrawWorld')->xlh_draw_gift($user_id,$num,$room_id); $reslut = model('BlindBoxTurntableGiftDrawWorldNew')->xlh_draw_gift($user_id,$num,$room_id);
return v($reslut['code'], $reslut['msg'], $reslut['data']); return v($reslut['code'], $reslut['msg'], $reslut['data']);
} }
/* /*

View File

@@ -539,7 +539,6 @@ class BlindBoxTurntableGiftDrawWorld extends Model
// 4. 批量插入礼包发放记录 // 4. 批量插入礼包发放记录
$this->batchInsertGiftBagReceiveLog($user_id, $boxTurntableLog, $bag_data, $room_id, $precomputedResults); $this->batchInsertGiftBagReceiveLog($user_id, $boxTurntableLog, $bag_data, $room_id, $precomputedResults);
// 5. 发送礼物 // 5. 发送礼物
$result = $this->sendGiftsToRecipients($precomputedResults, $room_id,$user_id,$heart_id,$auction_id); $result = $this->sendGiftsToRecipients($precomputedResults, $room_id,$user_id,$heart_id,$auction_id);
if (isset($result['code']) && $result['code'] !== 1) { if (isset($result['code']) && $result['code'] !== 1) {
@@ -582,16 +581,16 @@ class BlindBoxTurntableGiftDrawWorld extends Model
// 批量更新 // 批量更新
foreach ($inventoryUpdates as $giftId => $count) { foreach ($inventoryUpdates as $giftId => $count) {
$giftBagDetail = Db::name("vs_gift_bag_detail") // $giftBagDetail = Db::name("vs_gift_bag_detail")
->where('id', $giftId) // ->where('id', $giftId)
->find(); // ->find();
if (!$giftBagDetail) { // if (!$giftBagDetail) {
throw new \Exception("礼物详情不存在ID: " . $giftId); // throw new \Exception("礼物详情不存在ID: " . $giftId);
} // }
// 检查库存是否足够 // // 检查库存是否足够
if ($giftBagDetail['remaining_number'] < $count) { // if ($giftBagDetail['remaining_number'] < $count) {
throw new \Exception("礼物库存不足ID: " . $giftId); // throw new \Exception("礼物库存不足ID: " . $giftId);
} // }
$ret = db::name("vs_gift_bag_detail")->where('id',$giftId) $ret = db::name("vs_gift_bag_detail")->where('id',$giftId)
->setDec('remaining_number', $count); ->setDec('remaining_number', $count);
if (!$ret) { if (!$ret) {
@@ -783,6 +782,7 @@ class BlindBoxTurntableGiftDrawWorld extends Model
return ['code' => 0, 'msg' => $res['msg'], 'data' => null]; return ['code' => 0, 'msg' => $res['msg'], 'data' => null];
} }
} }
return ['code' => 1, 'msg' => '发送礼物成功', 'data' => null]; return ['code' => 1, 'msg' => '发送礼物成功', 'data' => null];
} }
@@ -1266,6 +1266,7 @@ class BlindBoxTurntableGiftDrawWorld extends Model
'createtime' => time() 'createtime' => time()
]); ]);
$is_zhong_jiang = 1; $is_zhong_jiang = 1;
unset($main_prize_updates);
}else{ }else{
$is_zhong_jiang = 0; $is_zhong_jiang = 0;
} }

File diff suppressed because it is too large Load Diff