Authored by 郝肖肖

店铺装修 商品列表 shopId参数

@@ -1187,6 +1187,10 @@ class HelperSearch @@ -1187,6 +1187,10 @@ class HelperSearch
1187 } 1187 }
1188 $queryPath = explode('?', $_SERVER['REQUEST_URI']); 1188 $queryPath = explode('?', $_SERVER['REQUEST_URI']);
1189 $params_arr = array(); 1189 $params_arr = array();
  1190 + //店铺装修,添加额外参数
  1191 + if (empty($params['shopId']) && isset($_REQUEST['shopId'])) {
  1192 + $params['shopId'] = $_REQUEST['shopId'];
  1193 + }
1190 foreach ($params as $key => $val) { 1194 foreach ($params as $key => $val) {
1191 if (is_array($val) || $val === '') { 1195 if (is_array($val) || $val === '') {
1192 continue; 1196 continue;
@@ -1322,6 +1326,10 @@ class HelperSearch @@ -1322,6 +1326,10 @@ class HelperSearch
1322 if (!empty(self::$specialsaleParam)) { 1326 if (!empty(self::$specialsaleParam)) {
1323 $url[0] .= '?' . http_build_query(self::$specialsaleParam); 1327 $url[0] .= '?' . http_build_query(self::$specialsaleParam);
1324 } 1328 }
  1329 + //店铺装修,添加额外参数
  1330 + if (empty($urlParam['shopId']) && isset($_REQUEST['shopId'])) {
  1331 + $urlParam['shopId'] = $_REQUEST['shopId'];
  1332 + }
1325 if (isset(self::$params['query'])) { 1333 if (isset(self::$params['query'])) {
1326 $urlParam['query'] = self::$params['query']; 1334 $urlParam['query'] = self::$params['query'];
1327 } 1335 }
@@ -1441,7 +1449,7 @@ class HelperSearch @@ -1441,7 +1449,7 @@ class HelperSearch
1441 if (self::$total == 0 || empty($shopSort)) { 1449 if (self::$total == 0 || empty($shopSort)) {
1442 return $shopEntry; 1450 return $shopEntry;
1443 } 1451 }
1444 - $url = Helpers::url('', '', $shop['brand_domain']); 1452 + $url = Helpers::url('', array('shopId' => $shop['shop_id']), $shop['brand_domain']);
1445 $sort = array(); 1453 $sort = array();
1446 $sortInfo = array(); 1454 $sortInfo = array();
1447 foreach ($shopSort as $msort) { 1455 foreach ($shopSort as $msort) {
@@ -445,11 +445,11 @@ class ShopModel @@ -445,11 +445,11 @@ class ShopModel
445 * @param type $data 445 * @param type $data
446 * @return type [] 446 * @return type []
447 */ 447 */
448 - public static function goodsTabBar($data) 448 + public static function goodsTabBar($data, $parameters)
449 { 449 {
450 $more = array( 450 $more = array(
451 'name' => 'MORE', 451 'name' => 'MORE',
452 - 'href' => self::$shopListUrl 452 + 'href' => self::$shopListUrl . '?shopId=' . $parameters['shopId']
453 ); 453 );
454 $result = array( 454 $result = array(
455 'hot' => array(), 455 'hot' => array(),
@@ -349,7 +349,13 @@ class IndexController extends WebAction @@ -349,7 +349,13 @@ class IndexController extends WebAction
349 $this->go(SITE_MAIN); 349 $this->go(SITE_MAIN);
350 } 350 }
351 351
352 - $shopId = $this->get('shopId', 0); 352 + //根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
  353 + $result = BrandsModel::getBrandByDomain($domain);
  354 + if (!$result) {
  355 + $this->go(SITE_MAIN);
  356 + }
  357 +
  358 + $shopId = isset($result['shopId']) ? $result['shopId'] : $this->get('shopId', 0);
353 //获取uid 359 //获取uid
354 $uid = $this->getUid(); 360 $uid = $this->getUid();
355 361
@@ -366,7 +372,7 @@ class IndexController extends WebAction @@ -366,7 +372,7 @@ class IndexController extends WebAction
366 ), 372 ),
367 'uid' => $uid, 373 'uid' => $uid,
368 'navBar' => $this->get('navBar', 1), 374 'navBar' => $this->get('navBar', 1),
369 - 'shopId' => $this->get('shopId', 0), 375 + 'shopId' => $shopId,
370 'brand' => $this->get('brand', 0) 376 'brand' => $this->get('brand', 0)
371 ); 377 );
372 378