定版之后bug修改-获取用户当前房间的巡乐会信息接口提交
This commit is contained in:
@@ -1133,4 +1133,35 @@ class BlindBoxTurntableGift extends Model
|
||||
}
|
||||
return ['code' => 1, 'msg' => '成功', 'data' => $list];
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取用户当前房间的巡乐会信息
|
||||
*/
|
||||
public function get_user_xlh_info($room_id){
|
||||
$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);
|
||||
$room_data = db('vs_room')
|
||||
->where(['id'=>$room_id])
|
||||
->field('id,room_name,xlh_periods,xlh_periods_num')
|
||||
->find();
|
||||
$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_status = 0;
|
||||
// 状态
|
||||
if($room_data['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']){
|
||||
$xlh_status = 2;//状态 1:巡乐会开始 2:即将开始开始 0:等待开始
|
||||
}else{
|
||||
$xlh_status = 0;//未开始
|
||||
}
|
||||
return ['code' => 1, 'msg' => '成功', 'data' => [
|
||||
'xlh_status'=>$xlh_data,
|
||||
'end_time'=>$xlh_data['end_time'] ?? 0,
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user