diff --git a/application/admin/controller/Goods.php b/application/admin/controller/Goods.php index 878f42de4..a09eecb31 100755 --- a/application/admin/controller/Goods.php +++ b/application/admin/controller/Goods.php @@ -14,7 +14,7 @@ use think\facade\Hook; use app\service\GoodsService; use app\service\RegionService; use app\service\BrandService; -use app\service\GoodsParamsTemplateService; +use app\service\GoodsParamsService; /** * 商品管理 @@ -211,7 +211,7 @@ class Goods extends Common ], 'field' => 'id,name', ); - $template = GoodsParamsTemplateService::GoodsParamsTemplateList($data_params); + $template = GoodsParamsService::GoodsParamsTemplateList($data_params); $this->assign('goods_template_list', $template['data']); // 是否拷贝 diff --git a/application/admin/controller/Goodsparamstemplate.php b/application/admin/controller/Goodsparamstemplate.php index 6abf28fc4..7bf8f4183 100755 --- a/application/admin/controller/Goodsparamstemplate.php +++ b/application/admin/controller/Goodsparamstemplate.php @@ -11,7 +11,7 @@ namespace app\admin\controller; use think\facade\Hook; -use app\service\GoodsParamsTemplateService; +use app\service\GoodsParamsService; /** * 商品参数管理 @@ -54,7 +54,7 @@ class GoodsParamsTemplate extends Common public function Index() { // 总数 - $total = GoodsParamsTemplateService::GoodsParamsTemplateTotal($this->form_where); + $total = GoodsParamsService::GoodsParamsTemplateTotal($this->form_where); // 分页 $page_params = [ @@ -73,7 +73,7 @@ class GoodsParamsTemplate extends Common 'n' => $this->page_size, 'order_by' => $this->form_order_by['data'], ]; - $ret = GoodsParamsTemplateService::GoodsParamsTemplateList($data_params); + $ret = GoodsParamsService::GoodsParamsTemplateList($data_params); // 基础参数赋值 $this->assign('params', $this->data_request); @@ -105,7 +105,7 @@ class GoodsParamsTemplate extends Common 'n' => 1, 'where' => $where, ]; - $ret = GoodsParamsTemplateService::GoodsParamsTemplateList($data_params); + $ret = GoodsParamsService::GoodsParamsTemplateList($data_params); $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; $this->assign('data', $data); @@ -142,7 +142,7 @@ class GoodsParamsTemplate extends Common 'where' => ['id'=>intval($params['id'])], 'field' => '*', ); - $ret = GoodsParamsTemplateService::GoodsParamsTemplateList($data_params); + $ret = GoodsParamsService::GoodsParamsTemplateList($data_params); $data = empty($ret['data'][0]) ? [] : $ret['data'][0]; } @@ -188,7 +188,7 @@ class GoodsParamsTemplate extends Common // 开始处理 $params = $this->data_request; - return GoodsParamsTemplateService::GoodsParamsTemplateSave($params); + return GoodsParamsService::GoodsParamsTemplateSave($params); } /** @@ -210,7 +210,7 @@ class GoodsParamsTemplate extends Common // 开始处理 $params = $this->data_request; $params['user_type'] = 'admin'; - return GoodsParamsTemplateService::GoodsParamsTemplateDelete($params); + return GoodsParamsService::GoodsParamsTemplateDelete($params); } /** @@ -231,7 +231,7 @@ class GoodsParamsTemplate extends Common // 开始处理 $params = $this->data_request; - return GoodsParamsTemplateService::GoodsParamsTemplateStatusUpdate($params); + return GoodsParamsService::GoodsParamsTemplateStatusUpdate($params); } } ?> \ No newline at end of file diff --git a/application/admin/view/default/site/siteset/search.html b/application/admin/view/default/site/siteset/search.html index e2cffb15c..623081969 100644 --- a/application/admin/view/default/site/siteset/search.html +++ b/application/admin/view/default/site/siteset/search.html @@ -26,6 +26,16 @@ +
+ +
+ + + + +
+
+
diff --git a/application/api/controller/User.php b/application/api/controller/User.php index f25257d4e..e30e1efc8 100755 --- a/application/api/controller/User.php +++ b/application/api/controller/User.php @@ -628,18 +628,9 @@ class User extends Common } // 用户信息处理 - $data = [ - 'openid' => $this->data_post['openid'], - 'mobile' => $mobile, - 'nickname' => isset($this->data_post['nickname']) ? $this->data_post['nickname'] : '', - 'avatar' => isset($this->data_post['avatar']) ? $this->data_post['avatar'] : '', - 'province' => isset($this->data_post['province']) ? $this->data_post['province'] : '', - 'city' => isset($this->data_post['city']) ? $this->data_post['city'] : '', - 'gender' => isset($this->data_post['gender']) ? intval($this->data_post['gender']) : '', - 'referrer' => isset($this->data_post['referrer']) ? $this->data_post['referrer'] : 0, - 'is_onekey_mobile_bind' => 1, - ]; - return UserService::AuthUserProgram($data, APPLICATION_CLIENT_TYPE.'_openid'); + $this->data_post['mobile'] = $mobile; + $this->data_post['is_onekey_mobile_bind'] = 1; + return UserService::AuthUserProgram($this->data_post, APPLICATION_CLIENT_TYPE.'_openid'); } } ?> \ No newline at end of file diff --git a/application/index/controller/Buy.php b/application/index/controller/Buy.php index 315787489..30861989b 100755 --- a/application/index/controller/Buy.php +++ b/application/index/controller/Buy.php @@ -132,105 +132,47 @@ class Buy extends Common */ private function PluginsHook($data = [], $params = []) { - // 订单确认页面顶部钩子 - $hook_name = 'plugins_view_buy_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + $hook_arr = [ + // 订单确认页面顶部钩子 + 'plugins_view_buy_top', - // 订单确认页面内部顶部钩子 - $hook_name = 'plugins_view_buy_inside_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面内部顶部钩子 + 'plugins_view_buy_inside_top', - // 订单确认页面地址底部钩子 - $hook_name = 'plugins_view_buy_address_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面地址底部钩子 + 'plugins_view_buy_address_bottom', - // 订单确认页面支付方式底部钩子 - $hook_name = 'plugins_view_buy_payment_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面支付方式底部钩子 + 'plugins_view_buy_payment_bottom', - // 订单确认页面分组商品底部钩子 - $hook_name = 'plugins_view_buy_group_goods_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面分组商品底部钩子 + 'plugins_view_buy_group_goods_bottom', - // 订单确认页面用户留言底部钩子 - $hook_name = 'plugins_view_buy_user_note_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面用户留言底部钩子 + 'plugins_view_buy_user_note_bottom', - // 订单确认页面订单确认信息顶部钩子 - $hook_name = 'plugins_view_buy_base_confirm_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面订单确认信息顶部钩子 + 'plugins_view_buy_base_confirm_top', - // 订单确认页面提交订单表单内部钩子 - $hook_name = 'plugins_view_buy_form_inside'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面提交订单表单内部钩子 + 'plugins_view_buy_form_inside', - // 订单确认页面内部底部钩子 - $hook_name = 'plugins_view_buy_inside_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面内部底部钩子 + 'plugins_view_buy_inside_bottom', - // 订单确认页面底部钩子 - $hook_name = 'plugins_view_buy_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'data' => $data, - 'params' => $params, - ])); + // 订单确认页面底部钩子 + 'plugins_view_buy_bottom', + ]; + foreach($hook_arr as $hook_name) + { + $this->assign($hook_name.'_data', Hook::listen($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + 'data' => $data, + 'params' => $params, + ])); + } } /** diff --git a/application/index/controller/Goods.php b/application/index/controller/Goods.php index 49a77dda4..48ece68d3 100755 --- a/application/index/controller/Goods.php +++ b/application/index/controller/Goods.php @@ -167,155 +167,62 @@ class Goods extends Common */ private function PluginsHook($goods_id, &$goods) { - // 商品页面相册内部钩子 - $hook_name = 'plugins_view_goods_detail_photo_within'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + $hook_arr = [ + // 商品页面相册内部钩子 + 'plugins_view_goods_detail_photo_within', - // 商品页面相册底部钩子 - $hook_name = 'plugins_view_goods_detail_photo_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); - - // 商品页面基础信息顶部钩子 - $hook_name = 'plugins_view_goods_detail_base_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面相册底部钩子 + 'plugins_view_goods_detail_photo_bottom', - // 商品页面基础信息面板底部钩子 - $hook_name = 'plugins_view_goods_detail_panel_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面基础信息顶部钩子 + 'plugins_view_goods_detail_base_top', - // 商品页面规格顶部钩子 - $hook_name = 'plugins_view_goods_detail_base_sku_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面基础信息面板底部钩子 + 'plugins_view_goods_detail_panel_bottom', - // 商品页面库存数量顶部钩子 - $hook_name = 'plugins_view_goods_detail_base_inventory_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面规格顶部钩子 + 'plugins_view_goods_detail_base_sku_top', - // 商品页面库存数量底部钩子 - $hook_name = 'plugins_view_goods_detail_base_inventory_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面库存数量顶部钩子 + 'plugins_view_goods_detail_base_inventory_top', - // 商品页面购买导航顶部钩子 - $hook_name = 'plugins_view_goods_detail_buy_nav_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面库存数量底部钩子 + 'plugins_view_goods_detail_base_inventory_bottom', - // 商品页面基础信息面板底部钩子 - $hook_name = 'plugins_view_goods_detail_base_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面购买导航顶部钩子 + 'plugins_view_goods_detail_buy_nav_top', - // 商品页面tabs顶部钩子 - $hook_name = 'plugins_view_goods_detail_tabs_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面基础信息面板底部钩子 + 'plugins_view_goods_detail_base_bottom', - // 商品页面tabs顶部钩子 - $hook_name = 'plugins_view_goods_detail_tabs_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面tabs顶部钩子 + 'plugins_view_goods_detail_tabs_top', - // 商品页面左侧顶部钩子 - $hook_name = 'plugins_view_goods_detail_left_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面tabs顶部钩子 + 'plugins_view_goods_detail_tabs_bottom', - // 商品页面基础信息标题里面钩子 - $hook_name = 'plugins_view_goods_detail_title'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面左侧顶部钩子 + 'plugins_view_goods_detail_left_top', - // 商品页面基础信息面板售价顶部钩子 - $hook_name = 'plugins_view_goods_detail_panel_price_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面基础信息标题里面钩子 + 'plugins_view_goods_detail_title', - // 商品页面基础信息购买小导航里面钩子 - $hook_name = 'plugins_view_goods_detail_base_buy_nav_min_inside'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'goods_id' => $goods_id, - 'goods' => &$goods, - ])); + // 商品页面基础信息面板售价顶部钩子 + 'plugins_view_goods_detail_panel_price_top', + + // 商品页面基础信息购买小导航里面钩子 + 'plugins_view_goods_detail_base_buy_nav_min_inside', + ]; + foreach($hook_arr as $hook_name) + { + $this->assign($hook_name.'_data', Hook::listen($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + 'goods_id' => $goods_id, + 'goods' => &$goods, + ])); + } } /** diff --git a/application/index/controller/Index.php b/application/index/controller/Index.php index 9f6cc9bce..51fe0f062 100755 --- a/application/index/controller/Index.php +++ b/application/index/controller/Index.php @@ -96,32 +96,25 @@ class Index extends Common */ private function PluginsHook($params = []) { - // 楼层数据顶部钩子 - $hook_name = 'plugins_view_home_floor_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'user' => $this->user, - ])); + $hook_arr = [ + // 楼层数据顶部钩子 + 'plugins_view_home_floor_top', - // 楼层数据底部钩子 - $hook_name = 'plugins_view_home_floor_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'user' => $this->user, - ])); + // 楼层数据底部钩子 + 'plugins_view_home_floor_bottom', - // 轮播混合数据底部钩子 - $hook_name = 'plugins_view_home_banner_mixed_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - 'user' => $this->user, - ])); + // 轮播混合数据底部钩子 + 'plugins_view_home_banner_mixed_bottom', + ]; + foreach($hook_arr as $hook_name) + { + $this->assign($hook_name.'_data', Hook::listen($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + 'user' => $this->user, + ])); + } } } ?> \ No newline at end of file diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index dfb1d5b0e..e023f736e 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -11,9 +11,8 @@ namespace app\index\controller; use think\facade\Hook; -use app\service\SearchService; -use app\service\BrandService; use app\service\SeoService; +use app\service\SearchService; use app\service\GoodsService; /** @@ -36,6 +35,25 @@ class Search extends Common public function __construct() { parent::__construct(); + + // 参数初始化 + $this->ParamsInit(); + } + + /** + * 参数初始化 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-06-02T01:38:27+0800 + */ + private function ParamsInit() + { + // 当前用户id + $this->data_request['user_id'] = empty($this->user) ? 0 : $this->user['id']; + + // 搜索关键字 + $this->data_request['wd'] = empty($this->data_request['wd']) ? '' : (IS_AJAX ? trim($this->data_request['wd']) : AsciiToStr($this->data_request['wd'])); } /** @@ -52,17 +70,25 @@ class Search extends Common { return redirect(MyUrl('index/search/index', ['wd'=>StrToAscii($keywords)])); } else { - // 参数初始化 - $this->ParamsInit(); - // 品牌列表 - $this->assign('brand_list', BrandService::CategoryBrandList(['category_id'=>$this->data_request['category_id'], 'keywords'=>$this->data_request['wd']])); + $brand_list = SearchService::CategoryBrandList($this->data_request); + $this->assign('brand_list', $brand_list); // 商品分类 - $this->assign('category_list', SearchService::GoodsCategoryList(['category_id'=>$this->data_request['category_id']])); + $category_list = SearchService::GoodsCategoryList($this->data_request); + $this->assign('category_list', $category_list); // 筛选价格区间 - $this->assign('screening_price_list', SearchService::ScreeningPriceList(['field'=>'id,name'])); + $screening_price_list = SearchService::ScreeningPriceList($this->data_request); + $this->assign('screening_price_list', $screening_price_list); + + // 商品参数 + $goods_params_list = SearchService::SearchGoodsParamsValueList($this->data_request); + $this->assign('goods_params_list', $goods_params_list); + + // 商品规格 + $goods_spec_list = SearchService::SearchGoodsSpecValueList($this->data_request); + $this->assign('goods_spec_list', $goods_spec_list); // 参数 $this->assign('params', $this->data_request); @@ -108,35 +134,6 @@ class Search extends Common $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle(empty($seo_title) ? '商品搜索' : $seo_title, 1)); } - /** - * 参数初始化 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @datetime 2019-06-02T01:38:27+0800 - */ - private function ParamsInit() - { - // 品牌id - $this->data_request['brand_id'] = isset($this->data_request['brand_id']) ? intval($this->data_request['brand_id']) : 0; - - // 分类id - $this->data_request['category_id'] = isset($this->data_request['category_id']) ? intval($this->data_request['category_id']) : 0; - - // 筛选价格id - $this->data_request['screening_price_id'] = isset($this->data_request['screening_price_id']) ? intval($this->data_request['screening_price_id']) : 0; - - // 搜索关键字 - $this->data_request['wd'] = empty($this->data_request['wd']) ? '' : (IS_AJAX ? trim($this->data_request['wd']) : AsciiToStr($this->data_request['wd'])); - - // 排序方式 - $this->data_request['order_by_field'] = empty($this->data_request['order_by_field']) ? 'default' : $this->data_request['order_by_field']; - $this->data_request['order_by_type'] = empty($this->data_request['order_by_type']) ? 'desc' : $this->data_request['order_by_type']; - - // 用户信息 - $this->data_request['user_id'] = isset($this->user['id']) ? $this->user['id'] : 0; - } - /** * 获取商品列表 * @author Devil @@ -152,19 +149,16 @@ class Search extends Common { $this->error('非法访问'); } - - // 参数初始化 - $this->ParamsInit(); // 获取商品列表 - $this->data_request['keywords'] = $this->data_request['wd']; $ret = SearchService::GoodsList($this->data_request); // 搜索记录 + $this->data_request['search_result_data'] = $ret['data']; SearchService::SearchAdd($this->data_request); // 无数据直接返回 - if(empty($ret['data']['data']) || $ret['code'] != 0) + if($ret['code'] != 0 || empty($ret['data']['data'])) { return DataReturn('没有更多数据啦', -100); } @@ -185,85 +179,54 @@ class Search extends Common */ private function PluginsHook() { - // 搜索页面顶部钩子 - $hook_name = 'plugins_view_search_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + $hook_arr = [ + // 搜索页面顶部钩子 + 'plugins_view_search_top', - // 搜索页面底部钩子 - $hook_name = 'plugins_view_search_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面底部钩子 + 'plugins_view_search_bottom', - // 搜索页面顶部内部结构里面钩子 - $hook_name = 'plugins_view_search_inside_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面顶部内部结构里面钩子 + 'plugins_view_search_inside_top', - // 搜索页面底部内部结构里面钩子 - $hook_name = 'plugins_view_search_inside_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面底部内部结构里面钩子 + 'plugins_view_search_inside_bottom', - // 搜索页面数据容器顶部钩子 - $hook_name = 'plugins_view_search_data_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面数据容器顶部钩子 + 'plugins_view_search_data_top', - // 搜索页面数据容器底部钩子 - $hook_name = 'plugins_view_search_data_bottom'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面数据容器底部钩子 + 'plugins_view_search_data_bottom', - // 搜索页面搜索导航条顶部钩子 - $hook_name = 'plugins_view_search_nav_top'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索条件顶部钩子 + 'plugins_view_search_map_top', - // 搜索页面搜索导航条内前面钩子 - $hook_name = 'plugins_view_search_nav_inside_begin'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面搜索导航条顶部钩子 + 'plugins_view_search_nav_top', - // 搜索页面搜索导航条内尾部钩子 - $hook_name = 'plugins_view_search_nav_inside_end'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面搜索导航条内前面钩子 + 'plugins_view_search_nav_inside_begin', - // 搜索页面筛选条件内尾部钩子 - $hook_name = 'plugins_view_search_screen_inside_end'; - $this->assign($hook_name.'_data', Hook::listen($hook_name, - [ - 'hook_name' => $hook_name, - 'is_backend' => false, - ])); + // 搜索页面搜索导航条内尾部钩子 + 'plugins_view_search_nav_inside_end', + + // 搜索页面筛选条件内前面钩子 + 'plugins_view_search_map_inside_begin', + + // 搜索页面筛选条件内基础底部钩子 + 'plugins_view_search_map_inside_base_bottom', + + // 搜索页面筛选条件内尾部钩子 + 'plugins_view_search_map_inside_end', + ]; + foreach($hook_arr as $hook_name) + { + $this->assign($hook_name.'_data', Hook::listen($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + ])); + } } } ?> \ No newline at end of file diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 7757608f5..af0744c64 100755 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -161,23 +161,34 @@ class User extends Common */ private function PluginsHook() { - // 顶部钩子 - $this->assign('plugins_view_user_center_top_data', Hook::listen('plugins_view_user_center_top', ['hook_name'=>'plugins_view_user_center_top', 'is_backend'=>false, 'user'=>$this->user])); + $hook_arr = [ + // 顶部钩子 + 'plugins_view_user_center_top', - // 基础信息底部钩子 - $this->assign('plugins_view_user_base_bottom_data', Hook::listen('plugins_view_user_base_bottom', ['hook_name'=>'plugins_view_user_base_bottom', 'is_backend'=>false, 'user'=>$this->user])); + // 基础信息底部钩子 + 'plugins_view_user_base_bottom', - // 聚合内容顶部钩子 - $this->assign('plugins_view_user_various_top_data', Hook::listen('plugins_view_user_various_top', ['hook_name'=>'plugins_view_user_various_top', 'is_backend'=>false, 'user'=>$this->user])); + // 聚合内容顶部钩子 + 'plugins_view_user_various_top', - // 聚合内容底部钩子 - $this->assign('plugins_view_user_various_bottom_data', Hook::listen('plugins_view_user_various_bottom', ['hook_name'=>'plugins_view_user_various_bottom', 'is_backend'=>false, 'user'=>$this->user])); + // 聚合内容底部钩子 + 'plugins_view_user_various_bottom', - // 聚合内容里面顶部钩子 - $this->assign('plugins_view_user_various_inside_top_data', Hook::listen('plugins_view_user_various_inside_top', ['hook_name'=>'plugins_view_user_various_inside_top', 'is_backend'=>false, 'user'=>$this->user])); + // 聚合内容里面顶部钩子 + 'plugins_view_user_various_inside_top', - // 聚合内容里面底部钩子 - $this->assign('plugins_view_user_various_bottom_data', Hook::listen('plugins_view_user_various_bottom', ['hook_name'=>'plugins_view_user_various_bottom', 'is_backend'=>false, 'user'=>$this->user])); + // 聚合内容里面底部钩子 + 'plugins_view_user_various_inside_bottom', + ]; + foreach($hook_arr as $hook_name) + { + $this->assign($hook_name.'_data', Hook::listen($hook_name, + [ + 'hook_name' => $hook_name, + 'is_backend' => false, + 'user' => $this->user, + ])); + } } /** diff --git a/application/index/view/default/search/index.html b/application/index/view/default/search/index.html index f85383c29..a7f183977 100755 --- a/application/index/view/default/search/index.html +++ b/application/index/view/default/search/index.html @@ -42,81 +42,186 @@ {{/foreach}} {{/if}} -
-
-
    -

    - 筛选出 - ... - 条数据 -

    -
  • -
    -
    已选
    -
    -

    清除

    -
    -
  • -
  • -
    -
    品牌
    -
    -
    不限
    - {{if !empty($brand_list)}} - {{foreach $brand_list as $brand}} -
    {{$brand.name}}
    - {{/foreach}} - {{else /}} - 没有相关品牌 - {{/if}} -
    -
    -
  • -
  • -
    -
    分类
    -
    -
    不限
    - {{if !empty($category_list)}} - {{foreach $category_list as $category}} -
    {{$category.name}}
    - {{/foreach}} - {{else /}} - 没有相关分类 - {{/if}} -
    -
    -
  • -
  • -
    -
    价格
    -
    -
    不限
    - {{if !empty($screening_price_list)}} - {{foreach $screening_price_list as $screening_price}} -
    {{$screening_price.name}}
    - {{/foreach}} - {{else /}} - 没有相关价格 - {{/if}} -
    -
    -
  • +
    + +
    +

    + 筛选出 + ... + 条数据 +

    + +
    - - {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} -
    - plugins_view_search_screen_inside_end -
    + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
    + plugins_view_search_map_top +
    + {{/if}} + {{if !empty($plugins_view_search_map_top_data) and is_array($plugins_view_search_map_top_data)}} + {{foreach $plugins_view_search_map_top_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} {{/if}} - {{if !empty($plugins_view_search_screen_inside_end_data) and is_array($plugins_view_search_screen_inside_end_data)}} - {{foreach $plugins_view_search_screen_inside_end_data as $hook}} - {{if is_string($hook) or is_int($hook)}} - {{$hook|raw}} + {{/foreach}} + {{/if}} + + +
    +
    +
    +
      + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
      + plugins_view_search_map_inside_begin +
      {{/if}} - {{/foreach}} - {{/if}} -
    + {{if !empty($plugins_view_search_map_inside_begin_data) and is_array($plugins_view_search_map_inside_begin_data)}} + {{foreach $plugins_view_search_map_inside_begin_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} + + +
  • +

    + 筛选出 + ... + 条数据 +

    + 清除 +
  • + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
    + plugins_view_search_map_inside_base_bottom +
    + {{/if}} + {{if !empty($plugins_view_search_map_inside_base_bottom_data) and is_array($plugins_view_search_map_inside_base_bottom_data)}} + {{foreach $plugins_view_search_map_inside_base_bottom_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} + + + {{if !empty($brand_list)}} +
  • +
    品牌
    +
    +
      + {{foreach $brand_list as $v}} +
    • + {{if empty($v['logo'])}} + {{$v.name}} + {{else /}} + {{$v.name}} + {{/if}} +
    • + {{/foreach}} +
    +
    + 更多 + +
    +
    +
  • + {{/if}} + + + {{if !empty($category_list)}} +
  • +
    分类
    +
    +
      + {{foreach $category_list as $v}} +
    • {{$v.name}}
    • + {{/foreach}} +
    +
    + 更多 + +
    +
    +
  • + {{/if}} + + + {{if !empty($screening_price_list)}} +
  • +
    价格
    +
    +
      + {{foreach $screening_price_list as $v}} +
    • {{$v.name}}
    • + {{/foreach}} +
    +
    + 更多 + +
    +
    +
  • + {{/if}} + + + {{if !empty($goods_params_list)}} +
  • +
    属性
    +
    +
      + {{foreach $goods_params_list as $v}} +
    • {{$v}}
    • + {{/foreach}} +
    +
    + 更多 + +
    +
    +
  • + {{/if}} + + + {{if !empty($goods_spec_list)}} +
  • +
    规格
    +
    +
      + {{foreach $goods_spec_list as $v}} +
    • {{$v}}
    • + {{/foreach}} +
    +
    + 更多 + +
    +
    +
  • + {{/if}} + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
    + plugins_view_search_map_inside_end +
    + {{/if}} + {{if !empty($plugins_view_search_map_inside_end_data) and is_array($plugins_view_search_map_inside_end_data)}} + {{foreach $plugins_view_search_map_inside_end_data as $hook}} + {{if is_string($hook) or is_int($hook)}} + {{$hook|raw}} + {{/if}} + {{/foreach}} + {{/if}} +
+
+
@@ -133,7 +238,8 @@ {{/foreach}} {{/if}} -
+ +