错误屏蔽

This commit is contained in:
2025-09-24 22:52:40 +08:00
parent 8a60cc55f9
commit f1879d1905
3 changed files with 145 additions and 129 deletions

View File

@@ -628,6 +628,7 @@ class BlindBoxTurntableGift extends Model
* 礼物特效播放 * 礼物特效播放
*/ */
public function gift_send($send_id){ public function gift_send($send_id){
try{
$blind_box_turntable = db('vs_blind_box_turntable_log')->where(['id'=>$send_id,'is_sued'=>0])->find(); $blind_box_turntable = db('vs_blind_box_turntable_log')->where(['id'=>$send_id,'is_sued'=>0])->find();
if(!$blind_box_turntable){ if(!$blind_box_turntable){
return ['code' => 1, 'msg' => '成功', 'data' => null]; return ['code' => 1, 'msg' => '成功', 'data' => null];
@@ -705,6 +706,10 @@ class BlindBoxTurntableGift extends Model
} }
db::name('vs_blind_box_turntable_log')->where('id', $send_id)->update(['is_sued' => 1, 'updatetime' => time()]); db::name('vs_blind_box_turntable_log')->where('id', $send_id)->update(['is_sued' => 1, 'updatetime' => time()]);
return ['code' => 1, 'msg' => '成功', 'data' => null]; return ['code' => 1, 'msg' => '成功', 'data' => null];
} catch (\Exception $e) {
return ['code' => 0, 'msg' => "网络请求错误,请重试!", 'data' => null];
}
} }
/* /*
@@ -1161,7 +1166,7 @@ class BlindBoxTurntableGift extends Model
} }
return [ return [
'activities_name' => $xlh_box['name'], 'activities_name' => $xlh_box['name'],
'ico' => null, 'icon' => null,
'xlh_status'=>$xlh_status, 'xlh_status'=>$xlh_status,
'end_time'=>$xlh_data['end_time'] ?? 0, 'end_time'=>$xlh_data['end_time'] ?? 0,
]; ];

View File

@@ -18,6 +18,7 @@ class BlindBoxTurntableGiftDraw extends Model
*/ */
public function draw_gift($gift_bag_id, $user_id, $gift_user_ids, $num = 1, $room_id = 0, $heart_id = 0) public function draw_gift($gift_bag_id, $user_id, $gift_user_ids, $num = 1, $room_id = 0, $heart_id = 0)
{ {
try {
// 1. 验证参数并提前处理错误 // 1. 验证参数并提前处理错误
$validationResult = $this->validateDrawParameters($gift_bag_id, $user_id, $gift_user_ids, $room_id); $validationResult = $this->validateDrawParameters($gift_bag_id, $user_id, $gift_user_ids, $room_id);
if ($validationResult !== true) { if ($validationResult !== true) {
@@ -76,6 +77,11 @@ class BlindBoxTurntableGiftDraw extends Model
// 6. 构建并返回结果 // 6. 构建并返回结果
return $this->buildDrawResult($boxTurntableLog, $giftCounts); return $this->buildDrawResult($boxTurntableLog, $giftCounts);
} catch (\Exception $e) {
return ['code' => 0, 'msg' => "网络请求错误,请重试!", 'data' => null];
}
} }
/** /**
* 验证抽奖参数 * 验证抽奖参数
@@ -755,11 +761,16 @@ class BlindBoxTurntableGiftDraw extends Model
$xlh['start_num'] = $xlh_ext['open_condition']['start_num'];//开始开奖次数 $xlh['start_num'] = $xlh_ext['open_condition']['start_num'];//开始开奖次数
// 当前抽奖次数 // 当前抽奖次数
$xlh['current_num'] = $currentXlhPeriodsNum; $xlh['current_num'] = $currentXlhPeriodsNum;
$xlh['end_time'] = 0;
// 状态 // 状态
if($xlh['current_num'] >= $xlh_ext['open_condition']['start_num']){ if($xlh['current_num'] >= $xlh_ext['open_condition']['start_num']){
$xlh['status'] = 1;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始 $xlh['status'] = 1;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
//查询巡乐会信息
$pan_xlh = db::name('vs_room_pan_xlh')->where('room_id',$room_id)->order('id desc')->find();
$xlh['end_time'] = $pan_xlh['end_time'] ?? 0;
} elseif($xlh['current_num'] >= $xlh_ext['open_condition']['waiting_start_num'] && $xlh['current_num'] < $xlh_ext['open_condition']['start_num']){ } elseif($xlh['current_num'] >= $xlh_ext['open_condition']['waiting_start_num'] && $xlh['current_num'] < $xlh_ext['open_condition']['start_num']){
$xlh['status'] = 2;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始 $xlh['status'] = 2;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
}else{ }else{
$xlh['status'] = 0; $xlh['status'] = 0;
} }

View File

@@ -926,7 +926,7 @@ class Tencent extends Model
if($quit_room) { if($quit_room) {
foreach ($quit_room as $v){ foreach ($quit_room as $v){
$room_type = db::name('vs_room')->where(['id' => $v['room_id'],'room_status' => 1])->field('step,type_id')->find(); $room_type = db::name('vs_room')->where(['id' => $v['room_id'],'room_status' => 1])->field('step,type_id')->find();
if(($room_type['type_id'] == 7 && ($room_type['step'] == 2 ||$room_type['step'] == 3)) || $room_type == 2){ if(isset($room_type) && ($room_type['type_id'] == 7 && ($room_type['step'] == 2 ||$room_type['step'] == 3)) || $room_type == 2){
$text['text'] = '掉线!'; $text['text'] = '掉线!';
$text['user_id'] = $uid; $text['user_id'] = $uid;
$text['type'] = 2; $text['type'] = 2;