爵位接口提交-前台-接口修改-礼物列表加爵位礼物是否显示

This commit is contained in:
2025-11-11 16:44:39 +08:00
parent bf28dee4fe
commit f67fbde73a
5 changed files with 22 additions and 10 deletions

View File

@@ -40,6 +40,7 @@ class Gift extends Model
$where['gift_price'] = ['>',$gift_price];
$where['label'] = ['<>',2];
}
$is_lock = 0;
$is_open_blind_box_turntable = 0;
if($room_id){
$is_open_blind_box_turntable = Db::name('vs_room')->where(['id'=>$room_id])->value('is_open_blind_box_turntable');
@@ -76,17 +77,16 @@ class Gift extends Model
});
$list = $list_data;
}
$is_exclusive_gifts = 0;
if ($label == 11) { // 专属礼物
$Nobility = model('api/Nobility')->getUserNobilityInfo($user_id);
$power_list_ids = array_column($Nobility['power_list'],'id');
if(in_array(5,$power_list_ids)){
$is_exclusive_gifts = 1;
}
foreach ($list as &$v) {
$v['is_exclusive_gifts'] = $is_exclusive_gifts;
if(!in_array(5,$power_list_ids)){
$is_lock = 1;
}
}
foreach ($list as &$v) {
$v['is_lock'] = $is_lock;
}
return ['code' => 1, 'msg' => '获取成功', 'data' => $list];
}
}