背包礼物一键全清
This commit is contained in:
@@ -161,6 +161,15 @@ class Room extends BaseCom
|
|||||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//房间送礼 背包一键全清
|
||||||
|
public function room_gift_all_clear()
|
||||||
|
{
|
||||||
|
$room_id = input('room_id', 0);
|
||||||
|
$to_uid = input('to_uid', 0);//收礼人ID
|
||||||
|
$reslut = model('Room')->room_gift_all_clear($this->uid, $room_id, $to_uid);
|
||||||
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
|
}
|
||||||
|
|
||||||
//房间榜单
|
//房间榜单
|
||||||
public function room_rank()
|
public function room_rank()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1290,6 +1290,19 @@ class Room extends Model
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//背包礼物一键全清
|
||||||
|
public function room_gift_all_clear($uid, $room_id, $user_id)
|
||||||
|
{
|
||||||
|
$user_gift_pack = db::name('vs_user_gift_pack')->where(['user_id'=>$uid,'is_tester'=>1,'is_use_give'=>1,'num'=>['>',0]])->select();
|
||||||
|
if (empty($user_gift_pack)) {
|
||||||
|
return ['code' => 0, 'msg' => '用户背包礼物不足', 'data' => null];
|
||||||
|
}
|
||||||
|
foreach ($user_gift_pack as $v){
|
||||||
|
model('GiveGift')->give_gift($uid, $user_id, $v['gid'], $v['num'],2,2, $room_id);
|
||||||
|
}
|
||||||
|
return ['code' => 1, 'msg' => '成功', 'data' => null];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//房间在线列表
|
//房间在线列表
|
||||||
public function room_online_list($room_id, $page, $limit)
|
public function room_online_list($room_id, $page, $limit)
|
||||||
|
|||||||
Reference in New Issue
Block a user