From 83ba869a591698535d6c405ca0d7b96f055fdeec Mon Sep 17 00:00:00 2001 From: devil_gong Date: Mon, 26 Nov 2018 16:00:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Api/Controller/SearchController.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/service/Application/Api/Controller/SearchController.class.php b/service/Application/Api/Controller/SearchController.class.php index 80315d864..da6ee4902 100755 --- a/service/Application/Api/Controller/SearchController.class.php +++ b/service/Application/Api/Controller/SearchController.class.php @@ -43,8 +43,20 @@ class SearchController extends CommonController */ public function Index() { + // 搜索记录 + SearchService::SearchAdd($this->params); + + // 获取数据 $result = SearchService::GoodsList($this->data_post); - $result['category'] = GoodsService::GoodsCategoryRow(['id'=>$this->data_post['category_id']]); + + // 分类 + if(!empty($this->data_post['category_id'])) + { + $result['category'] = GoodsService::GoodsCategoryRow(['id'=>$this->data_post['category_id']]); + } else { + $result['category'] = []; + } + $this->ajaxReturn(L('common_operation_success'), 0, $result); } }