爵位接口提交-前台-接口修改-礼物列表加爵位礼物是否显示
This commit is contained in:
@@ -25,8 +25,7 @@ class BlindBoxTurntable extends BaseCom
|
|||||||
public function get_gift_list(){
|
public function get_gift_list(){
|
||||||
$gift_bag_id = input('gift_bag_id',0);
|
$gift_bag_id = input('gift_bag_id',0);
|
||||||
$room_id = input('room_id',0);
|
$room_id = input('room_id',0);
|
||||||
$user_id = $this->uid ?? 0;
|
$reslut = model('BlindBoxTurntableGift')->get_gift_list($gift_bag_id,$room_id);
|
||||||
$reslut = model('BlindBoxTurntableGift')->get_gift_list($gift_bag_id,$room_id,$user_id);
|
|
||||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ class Gift extends BaseCom
|
|||||||
{
|
{
|
||||||
$label = input('label',0);
|
$label = input('label',0);
|
||||||
$room_id = input('room_id',0);
|
$room_id = input('room_id',0);
|
||||||
$reslut = model('Gift')->get_gift_list($label,$room_id);
|
$user_id = $this->uid ?? 0;
|
||||||
|
$reslut = model('Gift')->get_gift_list($label,$room_id,$user_id);
|
||||||
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
//聊天送礼物 (音信)
|
//聊天送礼物 (音信)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class RoomEmoji extends BaseCom
|
|||||||
public function emoji_list(){
|
public function emoji_list(){
|
||||||
$type_id = input('type_id', "");
|
$type_id = input('type_id', "");
|
||||||
$pid = input('pid', "");
|
$pid = input('pid', "");
|
||||||
|
$user_id = $this->uid ?? 0;
|
||||||
$reslut = model('RoomEmoji')->getRoomEmoji($type_id,$pid,true);
|
$reslut = model('RoomEmoji')->getRoomEmoji($type_id,$pid,true);
|
||||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class Gift extends Model
|
|||||||
$where['gift_price'] = ['>',$gift_price];
|
$where['gift_price'] = ['>',$gift_price];
|
||||||
$where['label'] = ['<>',2];
|
$where['label'] = ['<>',2];
|
||||||
}
|
}
|
||||||
|
$is_lock = 0;
|
||||||
$is_open_blind_box_turntable = 0;
|
$is_open_blind_box_turntable = 0;
|
||||||
if($room_id){
|
if($room_id){
|
||||||
$is_open_blind_box_turntable = Db::name('vs_room')->where(['id'=>$room_id])->value('is_open_blind_box_turntable');
|
$is_open_blind_box_turntable = Db::name('vs_room')->where(['id'=>$room_id])->value('is_open_blind_box_turntable');
|
||||||
@@ -76,16 +77,15 @@ class Gift extends Model
|
|||||||
});
|
});
|
||||||
$list = $list_data;
|
$list = $list_data;
|
||||||
}
|
}
|
||||||
$is_exclusive_gifts = 0;
|
|
||||||
if ($label == 11) { // 专属礼物
|
if ($label == 11) { // 专属礼物
|
||||||
$Nobility = model('api/Nobility')->getUserNobilityInfo($user_id);
|
$Nobility = model('api/Nobility')->getUserNobilityInfo($user_id);
|
||||||
$power_list_ids = array_column($Nobility['power_list'],'id');
|
$power_list_ids = array_column($Nobility['power_list'],'id');
|
||||||
if(in_array(5,$power_list_ids)){
|
if(!in_array(5,$power_list_ids)){
|
||||||
$is_exclusive_gifts = 1;
|
$is_lock = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($list as &$v) {
|
foreach ($list as &$v) {
|
||||||
$v['is_exclusive_gifts'] = $is_exclusive_gifts;
|
$v['is_lock'] = $is_lock;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ['code' => 1, 'msg' => '获取成功', 'data' => $list];
|
return ['code' => 1, 'msg' => '获取成功', 'data' => $list];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class RoomEmoji extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取房间表情包
|
//获取房间表情包
|
||||||
public function getRoomEmoji($type_id=0,$pid=0, $isTree = false){
|
public function getRoomEmoji($type_id=0,$pid=0, $isTree = false, $user_id = 0){
|
||||||
$where = [];
|
$where = [];
|
||||||
if($type_id){
|
if($type_id){
|
||||||
$where['type_id'] = $type_id;
|
$where['type_id'] = $type_id;
|
||||||
@@ -38,6 +38,17 @@ class RoomEmoji extends Model
|
|||||||
->where($where)
|
->where($where)
|
||||||
->order('sort desc,id desc')
|
->order('sort desc,id desc')
|
||||||
->select();
|
->select();
|
||||||
|
$is_lock = 0;
|
||||||
|
if ($type_id == 3) { // 专属礼物
|
||||||
|
$Nobility = model('api/Nobility')->getUserNobilityInfo($user_id);
|
||||||
|
$power_list_ids = array_column($Nobility['power_list'],'id');
|
||||||
|
if(!in_array(5,$power_list_ids)){
|
||||||
|
$is_lock = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($list as &$v) {
|
||||||
|
$v['is_lock'] = $is_lock;
|
||||||
|
}
|
||||||
if ($isTree && !empty($list) && empty($pid)) {
|
if ($isTree && !empty($list) && empty($pid)) {
|
||||||
$list = $this->buildTree($list);
|
$list = $this->buildTree($list);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user