Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -29,6 +29,11 @@ class RoomAuction extends BaseCom
|
||||
$room_id = input('room_id');
|
||||
$user_id = input('user_id');
|
||||
$gift_id = input('gift_id');
|
||||
//礼物不能是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];
|
||||
}
|
||||
$relation_id = input('relation_id','');
|
||||
$auction_type = input('auction_type',1);//1真爱拍 2 亲密拍
|
||||
$time_day = input('time_day', 0);//小时
|
||||
|
||||
@@ -84,8 +84,22 @@ class Gift extends Model
|
||||
$is_lock = 1;
|
||||
}
|
||||
}
|
||||
foreach ($list as &$v) {
|
||||
//获取配置里面的CP礼物
|
||||
$cp_gift_ids = explode(',', get_system_config_value('cp_gift_id'));
|
||||
$cp_gift = [];
|
||||
foreach ($list as $key =>&$v) {
|
||||
$v['is_lock'] = $is_lock;
|
||||
if (in_array($v['gift_id'], $cp_gift_ids)) {
|
||||
$v['is_cp'] = 1;
|
||||
$cp_gift[] = $v;
|
||||
unset($list[$key]);
|
||||
}else{
|
||||
$v['is_cp'] = 0;
|
||||
}
|
||||
}
|
||||
//如果有CP礼物 则放在最前面
|
||||
if ($cp_gift) {
|
||||
array_unshift($list, ...$cp_gift);
|
||||
}
|
||||
return ['code' => 1, 'msg' => '获取成功', 'data' => $list];
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user