From 91cc4a491553df0db5e6d7636ebd868feea97818 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Wed, 3 Nov 2021 00:05:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8E=A5=E5=8F=A3=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Search.php | 51 ++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/app/api/controller/Search.php b/app/api/controller/Search.php index 6edcbd215..52067b2ae 100755 --- a/app/api/controller/Search.php +++ b/app/api/controller/Search.php @@ -37,7 +37,7 @@ class Search extends Common } /** - * 商品搜索 + * 搜索初始化 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 @@ -45,6 +45,33 @@ class Search extends Common * @desc description */ public function Index() + { + $result = [ + // 指定数据 + 'search_map_info' => SearchService::SearchMapInfo($this->data_request), + // 品牌列表 + 'brand_list' => SearchService::CategoryBrandList($this->data_request), + // 商品分类 + 'category_list' => SearchService::GoodsCategoryList($this->data_request), + // 筛选价格区间 + 'screening_price_list' => SearchService::ScreeningPriceList($this->data_request), + // 商品参数 + 'goods_params_list' => SearchService::SearchGoodsParamsValueList($this->data_request), + // 商品规格 + 'goods_spec_list' => SearchService::SearchGoodsSpecValueList($this->data_request), + ]; + return ApiService::ApiDataReturn(SystemBaseService::DataReturn($result)); + } + + /** + * 数据列表 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-07-12 + * @desc description + */ + public function DataList() { // 搜索记录 $this->data_post['user_id'] = isset($this->user['id']) ? $this->user['id'] : 0; @@ -52,27 +79,7 @@ class Search extends Common // 获取数据 $ret = SearchService::GoodsList($this->data_post); - $result = $ret['data']; - - // 品牌列表 - $result['brand_list'] = SearchService::CategoryBrandList($this->data_request); - - // 指定数据 - $result['search_map_info'] = SearchService::SearchMapInfo($this->data_request); - - // 商品分类 - $result['category_list'] = SearchService::GoodsCategoryList($this->data_request); - - // 筛选价格区间 - $result['screening_price_list'] = SearchService::ScreeningPriceList($this->data_request); - - // 商品参数 - $result['goods_params_list'] = SearchService::SearchGoodsParamsValueList($this->data_request); - - // 商品规格 - $result['goods_spec_list'] = SearchService::SearchGoodsSpecValueList($this->data_request); - - return ApiService::ApiDataReturn(SystemBaseService::DataReturn($result)); + return ApiService::ApiDataReturn(SystemBaseService::DataReturn($ret['data'])); } } ?> \ No newline at end of file