Showing
3 changed files
with
19 additions
and
16 deletions
@@ -746,10 +746,10 @@ class HelperSearch | @@ -746,10 +746,10 @@ class HelperSearch | ||
746 | unset($params['color']); | 746 | unset($params['color']); |
747 | } | 747 | } |
748 | $result = array(); | 748 | $result = array(); |
749 | - $color = $filter['color']; | ||
750 | - if (!isset($color) && empty($color)) { | 749 | + if (!isset($filter['color']) && empty($filter['color'])) { |
751 | return $result; | 750 | return $result; |
752 | } | 751 | } |
752 | + $color = $filter['color']; | ||
753 | if (isset($color['color_id'])) { | 753 | if (isset($color['color_id'])) { |
754 | $checked = isset(self::$params['color']) && self::$params['color'] ==$color['color_id'] ? true : false; | 754 | $checked = isset(self::$params['color']) && self::$params['color'] ==$color['color_id'] ? true : false; |
755 | $result[] = array( | 755 | $result[] = array( |
@@ -1453,7 +1453,7 @@ class HelperSearch | @@ -1453,7 +1453,7 @@ class HelperSearch | ||
1453 | break 2; | 1453 | break 2; |
1454 | } | 1454 | } |
1455 | $sortInfo = array(); | 1455 | $sortInfo = array(); |
1456 | - $sortInfo['href'] = $url . '/?msort=' . $msort['sort_id'] . '&misort=' . $misort['sort_id']; | 1456 | + $sortInfo['href'] = "{$url}/?msort={$msort['sort_id']}&misort={$misort['sort_id']}&shopId={$shop['shop_id']}"; |
1457 | $sortInfo['name'] = $misort['sort_name']; | 1457 | $sortInfo['name'] = $misort['sort_name']; |
1458 | $sort[] = $sortInfo; | 1458 | $sort[] = $sortInfo; |
1459 | } | 1459 | } |
@@ -103,7 +103,7 @@ class ShopModel | @@ -103,7 +103,7 @@ class ShopModel | ||
103 | ); | 103 | ); |
104 | $sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId); | 104 | $sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId); |
105 | $searchCondition['userInput'] = empty($searchCondition['userInput']) ? array() : $searchCondition['userInput']; | 105 | $searchCondition['userInput'] = empty($searchCondition['userInput']) ? array() : $searchCondition['userInput']; |
106 | - $param = array_merge($searchCondition['userInput'], array('navBar' => 1)); | 106 | + $param = array_merge($searchCondition['userInput'], array('navBar' => 1, 'shopId' => $shopId)); |
107 | $data['allGoods']['list'] = $result['goods']; | 107 | $data['allGoods']['list'] = $result['goods']; |
108 | $data['allGoods']['name'] = '全部商品 ALL'; | 108 | $data['allGoods']['name'] = '全部商品 ALL'; |
109 | $data['allGoods']['opts'] = $result['opts']; | 109 | $data['allGoods']['opts'] = $result['opts']; |
@@ -273,20 +273,20 @@ class ShopModel | @@ -273,20 +273,20 @@ class ShopModel | ||
273 | $shopNav = array( | 273 | $shopNav = array( |
274 | array( | 274 | array( |
275 | 'name' => '店铺首页', | 275 | 'name' => '店铺首页', |
276 | - 'url' => '/?navBar=0', | 276 | + 'url' => '/?navBar=0&shopId=' . $parameters['shopId'], |
277 | ), | 277 | ), |
278 | array( | 278 | array( |
279 | 'name' => '全部商品', | 279 | 'name' => '全部商品', |
280 | - 'url' => self::$shopListUrl . '?navBar=1', | 280 | + 'url' => self::$shopListUrl . '?navBar=1&shopId=' . $parameters['shopId'], |
281 | 'arrow' => true, | 281 | 'arrow' => true, |
282 | ), | 282 | ), |
283 | array( | 283 | array( |
284 | 'name' => '人气单品', | 284 | 'name' => '人气单品', |
285 | - 'url' => self::$shopListUrl . '?navBar=2&order=s_n_desc', | 285 | + 'url' => self::$shopListUrl . '?navBar=2&order=s_n_desc&shopId=' . $parameters['shopId'], |
286 | ), | 286 | ), |
287 | array( | 287 | array( |
288 | 'name' => '新品上架', | 288 | 'name' => '新品上架', |
289 | - 'url' => self::$shopListUrl . '?navBar=3&order=s_t_desc', | 289 | + 'url' => self::$shopListUrl . '?navBar=3&order=s_t_desc&shopId=' . $parameters['shopId'], |
290 | ), | 290 | ), |
291 | ); | 291 | ); |
292 | 292 | ||
@@ -426,6 +426,7 @@ class ShopModel | @@ -426,6 +426,7 @@ class ShopModel | ||
426 | 'url' => Helpers::url( | 426 | 'url' => Helpers::url( |
427 | self::$shopListUrl, | 427 | self::$shopListUrl, |
428 | array( | 428 | array( |
429 | + 'shopId' => $parameters['shopId'], | ||
429 | 'brand' => $resource['id'], | 430 | 'brand' => $resource['id'], |
430 | 'navBar' => 1 | 431 | 'navBar' => 1 |
431 | ), | 432 | ), |
@@ -31,8 +31,13 @@ class IndexController extends WebAction | @@ -31,8 +31,13 @@ class IndexController extends WebAction | ||
31 | $type = intval(isset($result['type']) ? $result['type'] : ''); | 31 | $type = intval(isset($result['type']) ? $result['type'] : ''); |
32 | switch ($type) { | 32 | switch ($type) { |
33 | case 1: | 33 | case 1: |
34 | + $shopId = $this->get('shopId', 0); | ||
35 | + if (empty($shopId)) { | ||
34 | //无单品店有多品店:1--->搜索页 | 36 | //无单品店有多品店:1--->搜索页 |
35 | $this->go('http://search.yohobuy.com/?query=' . $domain); | 37 | $this->go('http://search.yohobuy.com/?query=' . $domain); |
38 | + } else { | ||
39 | + $this->shopHome($shopId); | ||
40 | + } | ||
36 | exit(0); | 41 | exit(0); |
37 | break; | 42 | break; |
38 | case 2: | 43 | case 2: |
@@ -318,7 +323,8 @@ class IndexController extends WebAction | @@ -318,7 +323,8 @@ class IndexController extends WebAction | ||
318 | ), | 323 | ), |
319 | 'uid' => $uid, | 324 | 'uid' => $uid, |
320 | 'navBar' => $this->get('navBar', 0), | 325 | 'navBar' => $this->get('navBar', 0), |
321 | - 'brand' => $this->get('brand', 0) | 326 | + 'brand' => $this->get('brand', 0), |
327 | + 'shopId' => $shopId | ||
322 | ); | 328 | ); |
323 | 329 | ||
324 | $data = array_merge( | 330 | $data = array_merge( |
@@ -339,16 +345,11 @@ class IndexController extends WebAction | @@ -339,16 +345,11 @@ class IndexController extends WebAction | ||
339 | { | 345 | { |
340 | //品牌域名,没有获取到品牌域名的跳转首页 | 346 | //品牌域名,没有获取到品牌域名的跳转首页 |
341 | $domain = $this->param('named'); | 347 | $domain = $this->param('named'); |
342 | - | ||
343 | - //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页 | ||
344 | - $result = BrandsModel::getBrandByDomain($domain); | ||
345 | - | ||
346 | - if (isset($result['code']) && $result['code'] !== 200 || empty($result['shopId'])) { | 348 | + if (empty($domain)) { |
347 | $this->go(SITE_MAIN); | 349 | $this->go(SITE_MAIN); |
348 | } | 350 | } |
349 | 351 | ||
350 | - $shopId = $result['shopId']; | ||
351 | - | 352 | + $shopId = $this->get('shopId', 0); |
352 | //获取uid | 353 | //获取uid |
353 | $uid = $this->getUid(); | 354 | $uid = $this->getUid(); |
354 | 355 | ||
@@ -365,6 +366,7 @@ class IndexController extends WebAction | @@ -365,6 +366,7 @@ class IndexController extends WebAction | ||
365 | ), | 366 | ), |
366 | 'uid' => $uid, | 367 | 'uid' => $uid, |
367 | 'navBar' => $this->get('navBar', 1), | 368 | 'navBar' => $this->get('navBar', 1), |
369 | + 'shopId' => $this->get('shopId', 0), | ||
368 | 'brand' => $this->get('brand', 0) | 370 | 'brand' => $this->get('brand', 0) |
369 | ); | 371 | ); |
370 | 372 |
-
Please register or login to post a comment