From b42927191adc191741974a289c6a1a269faa491a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Mon, 13 Oct 2025 16:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=9C=80=E6=B1=82-=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E9=9C=80=E6=B1=82-=E7=9B=B2=E7=9B=92=E8=BD=AC=E7=9B=98?= =?UTF-8?q?=E8=B0=83=E9=80=9A=E7=9B=98-=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/model/BlindBoxTurntableGift.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/application/api/model/BlindBoxTurntableGift.php b/application/api/model/BlindBoxTurntableGift.php index ecf091e..beeb1f7 100644 --- a/application/api/model/BlindBoxTurntableGift.php +++ b/application/api/model/BlindBoxTurntableGift.php @@ -792,10 +792,11 @@ class BlindBoxTurntableGift extends Model //巡乐会主礼物 $xlh_main_gift = db::name('vs_gift')->where('gid',$xlh_ext['locking_condition']['locking_gift_id'])->find(); //中奖用户 - $xlh_periods = $room_data['xlh_periods']??0; - $pan_xlh = db::name('vs_room_pan_xlh')->where(['room_id'=>$room_id,'periods'=>$xlh_periods,'send_time'=>0])->find(); + $xlh_periods = $xlh_box['periods']??0; + $pan_xlh = db::name('vs_room_pan_xlh')->where(['periods'=>$xlh_periods,'send_time'=>0])->find(); + $xlh_periods_num = Cache::get("xlh_periods_num") ?? 0; if(empty($pan_xlh)){ - if($room_data['xlh_periods_num'] >= $xlh_ext['open_condition']['start_num']){ + if($xlh_periods_num >= $xlh_ext['open_condition']['start_num']){ $pan_xlh_id = db::name('vs_room_pan_xlh')->insertGetId([ 'room_id' => $room_id, 'gift_id' => $xlh_ext['locking_condition']['locking_gift_id'], @@ -1162,17 +1163,19 @@ class BlindBoxTurntableGift extends Model ->where(['id'=>$room_id]) ->field('id,room_name,xlh_periods,xlh_periods_num') ->find(); - $room_data['xlh_periods'] = $room_data['xlh_periods'] ?? 0; - $xlh_data = db('vs_room_pan_xlh') - ->where(["room_id"=>$room_id,"periods"=>$room_data['xlh_periods']]) - ->field('id,room_id,periods,end_time') - ->find(); +// $room_data['xlh_periods'] = $room_data['xlh_periods'] ?? 0; +// $xlh_data = db('vs_room_pan_xlh') +// ->where(["room_id"=>$room_id,"periods"=>$room_data['xlh_periods']]) +// ->field('id,room_id,periods,end_time') +// ->find(); + $xlh_data = db('vs_room_pan_xlh')->where(["send_time"=>0])->field('id,room_id,periods,end_time')->order('periods desc')->find(); //寻乐会状态 $xlh_status = 0; // 状态 - if($room_data['xlh_periods_num'] >= $xlh_ext['open_condition']['start_num']){ + $xlh_periods_num = Cache::get("xlh_periods_num") ?? 0; + if($xlh_periods_num >= $xlh_ext['open_condition']['start_num']){ $xlh_status = 1;//状态 1:巡乐会开始 2:即将开始 0:等待开始 - } elseif($room_data['xlh_periods_num'] >= $xlh_ext['open_condition']['waiting_start_num'] && $room_data['xlh_periods_num'] < $xlh_ext['open_condition']['start_num']){ + } elseif($xlh_periods_num >= $xlh_ext['open_condition']['waiting_start_num'] && $xlh_periods_num < $xlh_ext['open_condition']['start_num']){ $xlh_status = 2;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始 }else{ $xlh_status = 0;//未开始 @@ -1193,7 +1196,7 @@ class BlindBoxTurntableGift extends Model $gift_bag_id = 13; $xlh_box = db::name('vs_gift_bag')->where('id',$gift_bag_id)->find(); $xlh_ext = json_decode($xlh_box['ext'],true); - $pan_xlh = db::name('vs_room_pan_xlh')->where(['send_time'=>0]) + $pan_xlh = db::name('vs_room_pan_xlh')->where(['room_id'=>$room_id]) ->order('id desc') ->page($page,$page_size) ->select();