新需求-活动需求-盲盒转盘调通盘-调试

This commit is contained in:
2025-10-13 18:07:08 +08:00
parent a17bcb1daf
commit 4628896157
2 changed files with 20 additions and 822 deletions

View File

@@ -749,7 +749,7 @@ class BlindBoxTurntableGiftDrawWorld extends Model
];
$push->xunlehui($text_list_new);
// 巡乐会正式开始
$this_xlh_periods = db::name('vs_room')->where('id',$room_id)->value('xlh_periods');
$this_xlh_periods = $this->getCachedXlhPeriods('get');
$pan_xlh_id = db::name('vs_room_pan_xlh')->insertGetId([
'room_id' => $room_id,
'gift_id' => $xlh_ext['locking_condition']['locking_gift_id'],
@@ -762,7 +762,7 @@ class BlindBoxTurntableGiftDrawWorld extends Model
if(!$pan_xlh_id){
return ['code' => 0, 'msg' => '创建巡乐会失败!', 'data' => []];
}
db::name("vs_gift_bag")->where('id',13)->setInc('periods');//修改巡乐会期数
$this->getCachedXlhPeriods('set', $this_xlh_periods+1);//修改巡乐会期数
}
}
private function updateAndPushXlhStatus($room_id, $xlh_ext, $currentXlhPeriodsNum){
@@ -934,6 +934,18 @@ class BlindBoxTurntableGiftDrawWorld extends Model
}
return $xlh_periods_num;
}
/**
* 获取缓存的巡乐会期数
*/
private function getCachedXlhPeriods($type="get",$periods=1) {
$cacheKey = "this_xlh_periods";
$xlh_periods_num = Cache::get($cacheKey) ?? 0;
if($type=="set"){
$xlh_periods_num = $periods;
Cache::set($cacheKey, $xlh_periods_num, 0);
}
return $xlh_periods_num;
}
/**
* 重置奖池
@@ -990,7 +1002,7 @@ class BlindBoxTurntableGiftDrawWorld extends Model
// 3. 检查巡乐会状态
$pan_xlh = db::name('vs_room_pan_xlh')
->where(['periods' => $bag_data['periods']])
->order('id', 'desc')
->find();
if (empty($pan_xlh)) {
return ['code' => 0, 'msg' => '未开始', 'data' => null];
@@ -1001,7 +1013,6 @@ class BlindBoxTurntableGiftDrawWorld extends Model
if ($pan_xlh['send_time'] != 0) {
return ['code' => 0, 'msg' => '本轮已结束,礼物已发放', 'data' => null];
}
// 4. 预加载必要数据
$gift_bag_detail = db::name("vs_gift_bag_detail")
->field('id,quantity,remaining_number,weight,foreign_id,gift_bag_id')