From 4e5fa3660c1bd09eb5bb2c9e8f088191d4271b60 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sun, 21 Oct 2018 00:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/CommonController.class.php | 4 +-- .../Controller/SearchController.class.php | 3 +++ .../Service/ResourcesService.class.php | 13 ---------- .../Service/SearchService.class.php | 26 +++++++++++++++++++ 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/service/Application/Home/Controller/CommonController.class.php b/service/Application/Home/Controller/CommonController.class.php index 0c2a2d8d9..445180985 100755 --- a/service/Application/Home/Controller/CommonController.class.php +++ b/service/Application/Home/Controller/CommonController.class.php @@ -7,7 +7,7 @@ use Service\GoodsService; use Service\NavigationService; use Service\BuyService; use Service\MessageService; -use Service\ResourcesService; +use Service\SearchService; /** * 前台 @@ -176,7 +176,7 @@ class CommonController extends Controller switch(intval(MyC('home_search_keywords_type', 0))) { case 1 : - $home_search_keywords = ResourcesService::SearchKeywordsList(); + $home_search_keywords = SearchService::SearchKeywordsList(); break; case 2 : $home_search_keywords = explode(',', MyC('home_search_keywords')); diff --git a/service/Application/Home/Controller/SearchController.class.php b/service/Application/Home/Controller/SearchController.class.php index 72d71722b..c2636057e 100755 --- a/service/Application/Home/Controller/SearchController.class.php +++ b/service/Application/Home/Controller/SearchController.class.php @@ -58,6 +58,9 @@ class SearchController extends CommonController { $this->redirect('Home/Search/Index', ['keywords'=>$this->params['keywords']]); } else { + // 搜索记录 + SearchService::SearchAdd($this->params); + // 品牌列表 $this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$this->params['category_id']])); diff --git a/service/Application/Service/ResourcesService.class.php b/service/Application/Service/ResourcesService.class.php index 4ae9c3dc9..a8d25d7e8 100755 --- a/service/Application/Service/ResourcesService.class.php +++ b/service/Application/Service/ResourcesService.class.php @@ -172,18 +172,5 @@ class ResourcesService return M('Region')->where($where)->field($field)->order('id asc, sort asc')->select(); } - - /** - * [SearchKeywordsList 获取热门关键字列表] - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @datetime 2018-10-20T23:55:06+0800 - * @param [array] $params [输入参数] - */ - public function SearchKeywordsList($params = []) - { - return ['自动的', '自动2']; - } } ?> \ No newline at end of file diff --git a/service/Application/Service/SearchService.class.php b/service/Application/Service/SearchService.class.php index 2e278316e..04d0ff03f 100755 --- a/service/Application/Service/SearchService.class.php +++ b/service/Application/Service/SearchService.class.php @@ -126,5 +126,31 @@ class SearchService } return $result; } + + /** + * [SearchAdd 搜索记录添加] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2018-10-21T00:37:44+0800 + * @param [array] $params [输入参数] + */ + public static function SearchAdd($params = []) + { + + } + + /** + * [SearchKeywordsList 获取热门关键字列表] + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2018-10-20T23:55:06+0800 + * @param [array] $params [输入参数] + */ + public function SearchKeywordsList($params = []) + { + return ['自动的', '自动2']; + } } ?> \ No newline at end of file