送礼优化 相关
This commit is contained in:
@@ -187,6 +187,7 @@ class Room extends BaseCom
|
||||
|
||||
|
||||
//直播间送礼
|
||||
//
|
||||
public function room_give_gift()
|
||||
{
|
||||
$key_name = "api:room:gift:" . $this->uid;
|
||||
@@ -236,7 +237,7 @@ class Room extends BaseCom
|
||||
public function room_online_list()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
if($room_id){
|
||||
if(!$room_id){
|
||||
return V(0, '房间不存在');
|
||||
}
|
||||
$page = input('page', 1);
|
||||
@@ -249,7 +250,7 @@ class Room extends BaseCom
|
||||
public function room_user_home()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
if($room_id){
|
||||
if(!$room_id){
|
||||
return V(0, '房间不存在');
|
||||
}
|
||||
$user_id = input('user_id', 0);
|
||||
@@ -352,7 +353,7 @@ class Room extends BaseCom
|
||||
public function room_info()
|
||||
{
|
||||
$room_id = input('room_id', 0);
|
||||
if($room_id){
|
||||
if(!$room_id){
|
||||
return V(0, '房间不存在');
|
||||
}
|
||||
$reslut = model('Room')->room_info($this->uid, $room_id);
|
||||
|
||||
@@ -68,11 +68,12 @@ class RoomAuction extends BaseCom
|
||||
$gift_id = input('gift_id');
|
||||
$num = input('num');
|
||||
$type = input('type',1);//1金币购买 2送背包礼物
|
||||
$gift_bag_id = input('gift_bag_id',0);
|
||||
$pool_gift_id = db::name('bb_lottery_config')->where(['key' => 'pool_gift_id'])->value('value');
|
||||
if($gift_id == $pool_gift_id){
|
||||
return V(0, '此礼物不能进行此操作');
|
||||
}
|
||||
$reslut = model('RoomAuction')->room_auction_join($auction_id,$user_id,$gift_id,$num,$type);
|
||||
$reslut = model('RoomAuction')->room_auction_join($auction_id,$user_id,$gift_id,$num,$type,$gift_bag_id);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,19 @@ class SendGift extends BaseCom
|
||||
{
|
||||
$key_name = "api:send:gift:" . $this->uid;
|
||||
redis_lock_exits($key_name);
|
||||
$room_id = input('room_id', 0);//房间ID
|
||||
$gift_id = input('gift_id', 0);//礼物ID
|
||||
$gift_num = (int)input('gift_num', 1);//礼物数量
|
||||
|
||||
$room_id = input('room_id/d', 0);//房间ID
|
||||
$gift_id = input('gift_id/d', 0);//礼物ID
|
||||
$gift_num = (int)input('gift_num/d', 1);//礼物数量
|
||||
$to_uid = input('to_uid', 0);//收礼人ID,逗号隔开的字符串
|
||||
$type = input('type', 1);//1金币购买 2送背包礼物
|
||||
$pit_number = input('pit_number', 0);
|
||||
$heart_id = input('heart_id', 0);//助力时的 ID
|
||||
$type = input('type/d', 1);//1金币购买 2送背包礼物
|
||||
$heart_id = input('heart_id/d', 0);//助力时的 ID
|
||||
$gift_bag_id = input('gift_bag_id/d', 0);//盲盒类型ID 7-初级,8-中级,9-高级
|
||||
|
||||
if($room_id <= 0 || $gift_id <= 0 || $to_uid <= 0 || $type <= 0){
|
||||
redis_unlocks($key_name);
|
||||
return V(0, '参数错误');
|
||||
}
|
||||
|
||||
//获取幸运币
|
||||
$pool_gift_id = db::name('bb_lottery_config')->where(['key' => 'pool_gift_id'])->value('value');
|
||||
@@ -34,13 +40,10 @@ class SendGift extends BaseCom
|
||||
//获取房间类型 1:交友/pk(二卡八),2:练歌房(声网点歌),3:亲密拍,4:真爱拍,6:私密房,7:互娱房,9:点唱/歌手房,10:签约房,11:酒吧房
|
||||
$room_type = model('Room')->get_room_type($room_id);
|
||||
|
||||
//送礼
|
||||
$reslut = model('SendGift')->give_gift($this->uid, $to_uid, $gift_id, $gift_num,2,$type, $room_id,$pit_number,0,);
|
||||
if($room_type == 1){
|
||||
redis_unlocks($key_name);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}elseif ($room_type == 2){
|
||||
$reslut = model('GiveGift')->give_gift($this->uid, $to_uid, $gift_id, $gift_num,2,$type, $room_id,$pit_number,0,$give_gift_ext);
|
||||
//送礼 (送礼用户,收礼用户组,礼物ID,数量,礼物类型,房间ID )
|
||||
$reslut = model('SendGift')->send_gift($this->uid, $to_uid, $gift_id, $gift_num, $type, $room_id, $gift_bag_id, $heart_id);
|
||||
|
||||
if($room_type == 2){//2:练歌房(声网点歌)
|
||||
if($reslut['code'] == 1){
|
||||
$room_pits = model('RoomSong')->get_charm_rank($room_id);
|
||||
if($room_pits['code'] == 1){
|
||||
@@ -54,11 +57,10 @@ class SendGift extends BaseCom
|
||||
}
|
||||
redis_unlocks($key_name);
|
||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}else{
|
||||
redis_unlocks($key_name);
|
||||
return V(1, '送礼成功');
|
||||
}
|
||||
|
||||
redis_unlocks($key_name);
|
||||
return V(1, '送礼成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user