diff --git a/application/api/model/GiftNew.php b/application/api/model/GiftNew.php index f07a068b..0f23a7fb 100644 --- a/application/api/model/GiftNew.php +++ b/application/api/model/GiftNew.php @@ -43,6 +43,11 @@ class GiftNew extends Model //根据类型组装查询条件 $where['is_show'] = 1; $where['delete_time'] = 0; + if ($label == 99) { + $gift_price = get_system_config_value('room_love_auction_cion'); + $where['gift_price'] = ['>',$gift_price]; + $where['label'] = ['<>',2]; + } switch ($type) { case 1: $where['label'] = $label; @@ -68,6 +73,49 @@ class GiftNew extends Model ->field('gid as gift_id,gift_name,base_image,gift_price,icon') ->where($where)->order('sort desc, gift_price asc')->select(); + if($label==2){ + foreach ($list as &$v) { + //获取盲盒列表 + $box_list = Db::name('vs_gift_bag')->where(['status'=>1])->where(['activities_id'=>["in",[4,5]]])->select(); + foreach ($box_list as $key =>$box) { + $ext = json_decode($box['ext'],true); + if ($ext['gift_id'] == $v['gift_id']) { + $v['gift_bag_name'] = $box['name']; + $v['rule'] = $ext['description']; + $v['rule_url'] = get_system_config_value('web_site')."/api/Page/get_gift_box_rule?box_id=".$box["id"]; + $v['activities_id'] = $box['activities_id']; + $v['gift_bag'] = $box['id']; + break; + } + } + //爆币 + $pool_gift_id = db::name('bb_lottery_config')->where(['key' => 'pool_gift_id'])->value('value'); + if($pool_gift_id == $v['gift_id']){ + $v['gift_bag_name'] = "幸运币活动"; + $v['rule'] = "幸运羽币"; + $v['rule_url'] = get_system_config_value('web_site')."/api/Page/page_show?id=35"; + $v['activities_id'] = 88; + $v['gift_bag'] = 0; + } + } + }else{ + //获取配置里面的CP礼物 + $cp_gift_ids = explode(',', get_system_config_value('cp_gift_id')); + $teacher_gift_ids = explode(',', get_system_config_value('master_special_gift')); + foreach ($list as $key =>&$v) { + $v['is_lock'] = $is_lock; + if (in_array($v['gift_id'], $cp_gift_ids)) { + $v['is_cp'] = 1; + }else{ + $v['is_cp'] = 0; + } + if (in_array($v['gift_id'], $teacher_gift_ids)) { + $v['is_teacher'] = 1; + }else{ + $v['is_teacher'] = 0; + } + } + } //================================到这里结束逻辑==================================