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

This commit is contained in:
2025-11-11 16:09:05 +08:00
parent 6f1fc408f6
commit bf28dee4fe
3 changed files with 15 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ class Gift extends Model
}
//拉去礼物列表
public function get_gift_list($label = 0,$room_id = 0)
public function get_gift_list($label = 0,$room_id = 0,$user_id = 0)
{
$map['delete_time'] = 0;
$where['is_show'] = 1;
@@ -76,6 +76,17 @@ 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;
}
}
return ['code' => 1, 'msg' => '获取成功', 'data' => $list];
}
}