选择礼物时 部分不能选择CP礼物

This commit is contained in:
2025-11-18 18:04:37 +08:00
parent 1e63d189b0
commit 74eccf0e4e
3 changed files with 18 additions and 0 deletions

View File

@@ -819,6 +819,12 @@ class RoomPit extends Model
if(!$gift_id){
return ['code' => 0, 'msg' => '请选择礼物', 'data' => null];
}
//礼物不能是CP礼物
$cp_gift_ids = explode(',', get_system_config_value('cp_gift_id'));
if (in_array($gift_id, $cp_gift_ids)) {
return ['code' => 0, 'msg' => '礼物不能是CP礼物请重新选择', 'data' => null];
}
if(!$gift_price){
$gift_price = db::name('vs_gift')->where(['gid' => $gift_id])->value('gift_price');
}

View File

@@ -79,6 +79,13 @@ class SingerSong extends Model
if ($res) {
return ['code' => 0, 'msg' => '请勿重复提交歌曲', 'data' => null];
}
//礼物不能是CP礼物
$cp_gift_ids = explode(',', get_system_config_value('cp_gift_id'));
if (in_array($gift_id, $cp_gift_ids)) {
return ['code' => 0, 'msg' => '礼物不能是CP礼物请重新选择', 'data' => null];
}
$data = [
'user_id' => $user_id,
'song_name' => $song_name,