抢红包条件验证提示语修改
This commit is contained in:
@@ -595,10 +595,37 @@ class RedpacketService
|
|||||||
*/
|
*/
|
||||||
private function checkUserOnMic($userId,$roomId)
|
private function checkUserOnMic($userId,$roomId)
|
||||||
{
|
{
|
||||||
$onPit = Db::name('vs_room_pit')->where(['user_id' => $userId,'room_id' => $roomId])->value('pit_number');
|
$room_type = Db::name('vs_room')->where('id',$roomId)->field('type_id,label_id');
|
||||||
if ($onPit <= 0){
|
//实际麦位
|
||||||
return false;
|
if($room_type['type_id'] == 1 || $room_type['type_id'] == 7 || $room_type['type_id'] == 8){
|
||||||
|
$onPit = Db::name('vs_room_pit')->where(['user_id' => $userId,'room_id' => $roomId])->value('pit_number');
|
||||||
|
if ($onPit <= 0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}elseif($room_type['type_id'] ==2){//拍卖
|
||||||
|
//获取房间的当前拍卖ID
|
||||||
|
$auctionId = Db::name('vs_room_auction')->where(['room_id' => $roomId,'status' => 2])->value('auction_id');
|
||||||
|
$onPit = [];
|
||||||
|
if($auctionId){
|
||||||
|
$onPits = model('api/RoomAuction')->room_auction_list_on($auctionId);
|
||||||
|
//提取数组里面的user_id的值 来判断用户是否在里面
|
||||||
|
$onPit = array_column($onPits,'user_id');
|
||||||
|
//拍卖位 从缓存中取 Cache::get('auction_user_'.$room_id)
|
||||||
|
$onpitNumber_10 = Cache::get('auction_user_'.$roomId);
|
||||||
|
if($onpitNumber_10){
|
||||||
|
$onPit[] = $onpitNumber_10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$onpitNumber_9 = Db::name('vs_room_pit')->where(['pit_number' => 9,'room_id' => $roomId])->value('user_id');
|
||||||
|
if($onpitNumber_9){
|
||||||
|
$onPit[] = $onpitNumber_9;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!in_array($userId,$onPit)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user