定版之后bug修改-获取用户当前房间的巡乐会信息接口提交
This commit is contained in:
@@ -1133,4 +1133,35 @@ class BlindBoxTurntableGift extends Model
|
|||||||
}
|
}
|
||||||
return ['code' => 1, 'msg' => '成功', 'data' => $list];
|
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,
|
||||||
|
]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1342,7 +1342,7 @@ class BlindBoxTurntableGiftDraw extends Model
|
|||||||
|
|
||||||
// 8. 处理推送消息
|
// 8. 处理推送消息
|
||||||
if ($is_zhong_jiang == 1) {
|
if ($is_zhong_jiang == 1) {
|
||||||
$this->handlePrizeNotification($user_id,$gift_id, $room_id, $pan_xlh_num, $end_time, $room['room_name']);
|
$this->handlePrizeNotification($user_id,$gift_id, $room_id, $pan_xlh_num, $end_time, $room['room_name'],$ext['locking_condition']['locking_gift_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9. 构建返回结果
|
// 9. 构建返回结果
|
||||||
@@ -1442,10 +1442,12 @@ class BlindBoxTurntableGiftDraw extends Model
|
|||||||
/**
|
/**
|
||||||
* 巡乐会抽奖-处理中奖通知
|
* 巡乐会抽奖-处理中奖通知
|
||||||
*/
|
*/
|
||||||
private function handlePrizeNotification($user_id,$gift_id, $room_id, $pan_xlh_num, $end_time, $room_name)
|
private function handlePrizeNotification($user_id,$gift_id, $room_id, $pan_xlh_num, $end_time, $room_name,$locking_gift_id)
|
||||||
{
|
{
|
||||||
$FromUserInfo = db::name('user')->field('nickname,avatar')->where(['id' => $user_id])->find();
|
$FromUserInfo = db::name('user')->field('nickname,avatar')->where(['id' => $user_id])->find();
|
||||||
$gift_info = db::name('vs_gift')->field('gift_name')->where(['gid' => $gift_id])->find();
|
$gift_info = db::name('vs_gift')->field('gift_name')->where(['gid' => $gift_id])->find();
|
||||||
|
$locking_gift = db::name('vs_gift')->field('gift_name')->where(['gid' => $locking_gift_id])->find();
|
||||||
|
//锁定礼物
|
||||||
|
|
||||||
$text = [
|
$text = [
|
||||||
'gift_num' => $pan_xlh_num,
|
'gift_num' => $pan_xlh_num,
|
||||||
@@ -1455,6 +1457,16 @@ class BlindBoxTurntableGiftDraw extends Model
|
|||||||
];
|
];
|
||||||
|
|
||||||
model('Chat')->sendMsg(1057, $room_id, $text);
|
model('Chat')->sendMsg(1057, $room_id, $text);
|
||||||
|
|
||||||
|
//推送礼物横幅
|
||||||
|
$text = $FromUserInfo['nickname'] . ' 用户在 ' . $room_name.' 房间巡乐会 锁定 礼物' .$locking_gift.' 当前奖池礼物 x ' .$pan_xlh_num;
|
||||||
|
$push = new Push(0, $room_id);
|
||||||
|
$text_list_new = [
|
||||||
|
'text' => $text,
|
||||||
|
'room_id' => $room_id,
|
||||||
|
'from_type' => 1
|
||||||
|
];
|
||||||
|
$push->xunlehui($text_list_new);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user