getUserInfo(); // $data = model(ActivityService::class)->getActivityInfo($parames); $res = model('Goods','service')->getGoodsSearch($user_info,$parames); unset($res['code']); unset($res['msg']); unset($res['to_select']); $data['goods_list'] = $res['data']; return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'),$data); }catch (Exception $exception){ return self::returnMsg(self::ERR_NONE, $exception->getMessage()); } } /** * @apiVersion 1.0.0 * @api {post} /activity/group 2.活动组合(朱晓伟) * @apiName group * @apiGroup Activity * @apiHeader {String} authentication 验证 * @apiParam {String} id 活动id 例如 1,2,3,4 * @apiParam {Int} [limit] 每页多少条(默认20) * @apiParam {Int} [page] 当前页(默认1) * @apiSuccessExample Success-Response: *{ "code": 200, "message": "成功", "data": [ { "id": 8, "activity_name": "爆款首推", "activity_belong": 2, "activity_type": 3, "is_self": 0, "is_new": 0, "cover_img": "", "is_goods_only": 1, "nid": "", "activity_desc": "", "activity_level": 0, "fid": 0, "sort_num": 1, "start_time": null, "end_time": null, "create_time": "2020-05-15 04:25:09", "update_time": "2020-05-15 16:25:50", "verify_status": 0, "online_status": 1, "create_user": 1, "admin_user_id": 1, "remark": "", "more_info": null, "list": { "code": 200, "msg": "success", "data": { "total": 0, "per_page": 30, "current_page": 1, "last_page": 0, "data": [] } } }, { "id": 9, "activity_name": "热卖推荐", "activity_belong": 2, "activity_type": 3, "is_self": 0, "is_new": 0, "cover_img": "", "is_goods_only": 0, "nid": "", "activity_desc": "", "activity_level": 0, "fid": 0, "sort_num": 0, "start_time": null, "end_time": null, "create_time": "2020-05-15 04:25:39", "update_time": "2020-05-15 16:25:53", "verify_status": 0, "online_status": 1, "create_user": 1, "admin_user_id": 1, "remark": "", "more_info": null, "list": { "code": 200, "msg": "success", "data": { "total": 4, "per_page": 30, "current_page": 1, "last_page": 1, "data": [ { "price": "价格登录可见", "original_price": "价格登录可见", "goods_id": 1917, "goods_name": "百令胶囊", "show_price": "79.80", "is_online_sale": 0, "country_code": "Z10910036", "app_thumb": "", "pc_thumb": "ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/pc_shop_thumb_url_1542437212405.jpg", "drug_form": "胶囊剂", "keyword": "百令胶囊", "sketch": "肺肾两虚引起的咳嗽、气喘、咯血、腰背酸痛;慢性支气管炎的辅助治疗", "manufacturer_name": "杭州中美华东制药有限公司", "spec_desc": "0.5g*42s", "batch_type": 1, "supplier_id": 1, "supplier_sn": "", "batch_id": 4112, "retail_flag": 1, "retail_num": 10, "entirety_num": 200, "batch_number": "1912323", "stock_num": 800, "term_validity": "2022-11-30", "sale_num": 200, "sku_id": 13444, "area_id": 0, "price_type": 0, "is_buy": 0 }, { "price": "价格登录可见", "original_price": "价格登录可见", "goods_id": 2649, "goods_name": "厄贝沙坦片(苏适", "show_price": "21.40", "is_online_sale": 0, "country_code": "H20000511", "app_thumb": "", "pc_thumb": "ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/pc_shop_thumb_url_1588042489382.png", "drug_form": "片剂", "keyword": "厄贝沙坦片", "sketch": "治疗原发性高血压。\n合并高血压的2型糖尿病肾病的治疗。", "manufacturer_name": "深圳市海滨制药有限公司", "spec_desc": "0.15g*7s", "batch_type": 1, "supplier_id": 1, "supplier_sn": "", "batch_id": 4075, "retail_flag": 1, "retail_num": 10, "entirety_num": 400, "batch_number": "4190611051", "stock_num": 1600, "term_validity": "2021-05-10", "sale_num": 0, "sku_id": 13407, "area_id": 0, "price_type": 0, "is_buy": 0 }, { "price": "价格登录可见", "original_price": "价格登录可见", "goods_id": 2376, "goods_name": "参松养心胶囊", "show_price": "31.50", "is_online_sale": 0, "country_code": "Z20103032", "app_thumb": "", "pc_thumb": "ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/pc_shop_thumb_url_1575344012699.jpg", "drug_form": "胶囊剂", "keyword": "参松养心胶囊", "sketch": "益气养阴,活血通络,清心安神。用于治疗气阴两虚,心络瘀阻引起的冠心病室性早搏,症见心悸不安,气短乏力", "manufacturer_name": "北京以岭药业股份有限公司", "spec_desc": "0.4g*36s", "batch_type": 1, "supplier_id": 1, "supplier_sn": "", "batch_id": 3383, "retail_flag": 0, "retail_num": 10, "entirety_num": 400, "batch_number": "1905023", "stock_num": 380, "term_validity": "2022-04-30", "sale_num": 50, "sku_id": 12715, "area_id": 0, "price_type": 0, "is_buy": 0 }, { "price": "价格登录可见", "original_price": "价格登录可见", "goods_id": 2358, "goods_name": "酒石酸美托洛尔片", "show_price": "9.50", "is_online_sale": 0, "country_code": "H20065355", "app_thumb": "", "pc_thumb": "ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/pc_shop_thumb_url_1574747304847.png", "drug_form": "片剂", "keyword": "酒石酸美托洛尔片", "sketch": "用于治疗高血压、心绞痛、心肌梗死、肥厚型心肌病、主动脉夹层、心律失常、甲状腺机能亢进、心脏神经官能症", "manufacturer_name": "石家庄以岭药业股份有限公司", "spec_desc": "25mg*10s*2板", "batch_type": 1, "supplier_id": 1, "supplier_sn": "", "batch_id": 3328, "retail_flag": 0, "retail_num": 10, "entirety_num": 400, "batch_number": "A1908002", "stock_num": 400, "term_validity": "2021-07-31", "sale_num": 0, "sku_id": 12660, "area_id": 0, "price_type": 0, "is_buy": 0 } ] } } } ] } */ public function group() { try{ $parames = input(''); if(!isset($parames['id'])){ return self::returnMsg(self::ERR_EMPTY_PARAM, self::getMessage('ERR_EMPTY_PARAM')); } $user_info = $this->getUserInfo(); $ids = explode(',',$parames['id']); $activity_list = Db::name('activity')->where('id','in',$ids)->where('activity_type',3)->select(); $list = []; foreach ($activity_list as $activity){ $data['activity_id'] = $activity['id']; $item = $activity; $item['list'] = $res = model('Goods','service')->getGoodsSearch($user_info,$data); $list[] = $item; } return self::returnMsg(self::SUCCESS, self::getMessage('SUCCESS'),$list); }catch (Exception $exception){ return self::returnMsg(self::ERR_NONE, $exception->getMessage()); } } }