巡乐会抽奖接口提交.-后台列表修改
This commit is contained in:
@@ -28,7 +28,7 @@ class Gift extends Model
|
||||
}
|
||||
|
||||
//拉去礼物列表
|
||||
public function get_gift_list($label=0)
|
||||
public function get_gift_list($label=0,$room_id=0)
|
||||
{
|
||||
$map['delete_time'] = 0;
|
||||
$where['is_show'] = 1;
|
||||
@@ -42,9 +42,18 @@ class Gift extends Model
|
||||
$list = $this->field('gid as gift_id,gift_name,base_image,gift_price')->where($map)->where($where)->order('sort asc, gift_price asc')->select();
|
||||
|
||||
if($label==2){
|
||||
$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');
|
||||
}
|
||||
if($is_open_blind_box_turntable==1){
|
||||
$activities_id = [4,5];
|
||||
}else{
|
||||
$activities_id = [4];
|
||||
}
|
||||
foreach ($list as &$v) {
|
||||
//获取盲盒列表
|
||||
$box_list = Db::name('vs_gift_bag')->where(['status'=>1])->where(['activities_id'=>["in",[4,5]]])->select();
|
||||
$box_list = Db::name('vs_gift_bag')->where(['status'=>1])->where(['activities_id'=>["in",$activities_id]])->select();
|
||||
foreach ($box_list as $key =>$box) {
|
||||
$ext = json_decode($box['ext'],true);
|
||||
if ($ext['gift_id'] == $v['gift_id']) {
|
||||
|
||||
Reference in New Issue
Block a user