Showing
4 changed files
with
40 additions
and
13 deletions
@@ -177,8 +177,15 @@ class HelperSearch | @@ -177,8 +177,15 @@ class HelperSearch | ||
177 | self::setSearchNav($data['product']['total']); | 177 | self::setSearchNav($data['product']['total']); |
178 | } | 178 | } |
179 | //品牌店铺信息 | 179 | //品牌店铺信息 |
180 | - if (isset($data['shop']) && !empty($data['shop']) && isset($data['shopSort'])) { | ||
181 | - $result['shopEntry'] = self::shop($data['shop'], $data['shopSort']); | 180 | + if (isset($data['shopData']) && !empty($data['shopData'])) { |
181 | + $result['shopEntry'] = array(); | ||
182 | + foreach ($data['shopData'] as $val) { | ||
183 | + $shopSort = self::shop($val['shop'], $val['shopSort']); | ||
184 | + if (empty($shopSort)) { | ||
185 | + continue; | ||
186 | + } | ||
187 | + $result['shopEntry'][] = $shopSort; | ||
188 | + } | ||
182 | } | 189 | } |
183 | //分页 | 190 | //分页 |
184 | if (isset($result['totalCount'])) { | 191 | if (isset($result['totalCount'])) { |
@@ -307,6 +314,11 @@ class HelperSearch | @@ -307,6 +314,11 @@ class HelperSearch | ||
307 | $isNew = false; | 314 | $isNew = false; |
308 | $isSale = false; | 315 | $isSale = false; |
309 | } | 316 | } |
317 | + | ||
318 | + if (isset($options['isNew']) && $options['isNew']) { | ||
319 | + $isNew = true; | ||
320 | + } | ||
321 | + | ||
310 | //SALE、NEW标签不共存 | 322 | //SALE、NEW标签不共存 |
311 | if ($isNew) { | 323 | if ($isNew) { |
312 | $isSale = false; | 324 | $isSale = false; |
@@ -323,7 +335,7 @@ class HelperSearch | @@ -323,7 +335,7 @@ class HelperSearch | ||
323 | 'name' => $val['product_name'], | 335 | 'name' => $val['product_name'], |
324 | 'salePrice' => $val['sales_price'], | 336 | 'salePrice' => $val['sales_price'], |
325 | 'brand' => array( | 337 | 'brand' => array( |
326 | - 'url' => Helpers::url('', '', $val['brand_domain']), | 338 | + 'url' => Helpers::url('', '', isset($val['brand_domain']) ? $val['brand_domain'] : ''), |
327 | 'name' => $val['brand_name'] | 339 | 'name' => $val['brand_name'] |
328 | ), | 340 | ), |
329 | 'isFew' => $isFew, | 341 | 'isFew' => $isFew, |
@@ -1426,7 +1438,7 @@ class HelperSearch | @@ -1426,7 +1438,7 @@ class HelperSearch | ||
1426 | public static function shop($shop, $shopSort) | 1438 | public static function shop($shop, $shopSort) |
1427 | { | 1439 | { |
1428 | $shopEntry = array(); | 1440 | $shopEntry = array(); |
1429 | - if (self::$total == 0) { | 1441 | + if (self::$total == 0 || empty($shopSort)) { |
1430 | return $shopEntry; | 1442 | return $shopEntry; |
1431 | } | 1443 | } |
1432 | $url = Helpers::url('', '', $shop['brand_domain']); | 1444 | $url = Helpers::url('', '', $shop['brand_domain']); |
@@ -1446,6 +1458,7 @@ class HelperSearch | @@ -1446,6 +1458,7 @@ class HelperSearch | ||
1446 | $sort[] = $sortInfo; | 1458 | $sort[] = $sortInfo; |
1447 | } | 1459 | } |
1448 | } | 1460 | } |
1461 | + $shop['brand_ico'] = strstr($shop['brand_ico'], '?', true); | ||
1449 | $shopEntry['home'] = $url; | 1462 | $shopEntry['home'] = $url; |
1450 | $shopEntry['logo'] = Images::getImageUrl($shop['brand_ico'], 80, 50, 1, 'brandLogo'); | 1463 | $shopEntry['logo'] = Images::getImageUrl($shop['brand_ico'], 80, 50, 1, 'brandLogo'); |
1451 | $shopEntry['shopName'] = $shop['brand_name']; | 1464 | $shopEntry['shopName'] = $shop['brand_name']; |
1 | {{# shopTopBanner}} | 1 | {{# shopTopBanner}} |
2 | <div class="shop-banner"> | 2 | <div class="shop-banner"> |
3 | <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div> | 3 | <div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div> |
4 | - {{#if shopsType}} | 4 | + {{#if isShowShopName}} |
5 | <div class="shop-name"> | 5 | <div class="shop-name"> |
6 | - {{brandName}} | 6 | + {{brandIntro.brandName}} |
7 | </div> | 7 | </div> |
8 | {{/if}} | 8 | {{/if}} |
9 | <div class="opt-wrap"> | 9 | <div class="opt-wrap"> |
@@ -45,6 +45,7 @@ class SearchModel | @@ -45,6 +45,7 @@ class SearchModel | ||
45 | $data = array(); | 45 | $data = array(); |
46 | /* 过滤请求参数 */ | 46 | /* 过滤请求参数 */ |
47 | $condition = filter_input_array(INPUT_GET, array( | 47 | $condition = filter_input_array(INPUT_GET, array( |
48 | + 'navBar' => FILTER_VALIDATE_INT, | ||
48 | 'query' => FILTER_FLAG_NO_ENCODE_QUOTES , | 49 | 'query' => FILTER_FLAG_NO_ENCODE_QUOTES , |
49 | 'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES , | 50 | 'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES , |
50 | 'brand' => FILTER_SANITIZE_STRING, | 51 | 'brand' => FILTER_SANITIZE_STRING, |
@@ -235,10 +236,15 @@ class SearchModel | @@ -235,10 +236,15 @@ class SearchModel | ||
235 | $data = Yohobuy::getMulti($urlList); | 236 | $data = Yohobuy::getMulti($urlList); |
236 | //获取品牌商品分类 | 237 | //获取品牌商品分类 |
237 | if (isset($data['shop']) && !empty($data['shop'])) { | 238 | if (isset($data['shop']) && !empty($data['shop'])) { |
238 | - $shopSortParam['brand'] = $data['shop']['id']; | ||
239 | - $shopSort = SearchData::getClassesData($shopSortParam); | ||
240 | - if (isset($shopSort['code']) && $shopSort['code'] == 200) { | ||
241 | - $data['shopSort'] = $shopSort['data']['sort']; | 239 | + $data['shopData'] = array(); |
240 | + $shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']); | ||
241 | + if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) { | ||
242 | + foreach ($shopsByBrands['data'] as $val) { | ||
243 | + $shopSort = SearchData::getClassesData(array('brand' => $val['brand_id'])); | ||
244 | + if (isset($shopSort['code']) && $shopSort['code'] == 200) { | ||
245 | + $data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']); | ||
246 | + } | ||
247 | + } | ||
242 | } | 248 | } |
243 | } | 249 | } |
244 | // 组织模板数据 | 250 | // 组织模板数据 |
@@ -245,13 +245,21 @@ class ShopModel | @@ -245,13 +245,21 @@ class ShopModel | ||
245 | { | 245 | { |
246 | $result = array( | 246 | $result = array( |
247 | 'banner' => '', | 247 | 'banner' => '', |
248 | + 'isShowShopName' => false, | ||
248 | 'bannerHeight' => 150 | 249 | 'bannerHeight' => 150 |
249 | ); | 250 | ); |
250 | - | 251 | + |
251 | if (isset($data['resource_data'][0]['shopSrc'])) { | 252 | if (isset($data['resource_data'][0]['shopSrc'])) { |
252 | $result['banner'] = self::imageView2($data['resource_data'][0]['shopSrc'], 1150, 150); | 253 | $result['banner'] = self::imageView2($data['resource_data'][0]['shopSrc'], 1150, 150); |
253 | } | 254 | } |
254 | - | 255 | + |
256 | + if (isset($data['resource_data'][0]['detailSrc'])) { | ||
257 | + $result['detailSrc'] = self::imageView2($data['resource_data'][0]['detailSrc'], 1150, 150); | ||
258 | + } | ||
259 | + | ||
260 | + if (isset($data['resource_data'][0]['isShowShopName'])) { | ||
261 | + $result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y'; | ||
262 | + } | ||
255 | return $result; | 263 | return $result; |
256 | 264 | ||
257 | } | 265 | } |
@@ -498,7 +506,7 @@ class ShopModel | @@ -498,7 +506,7 @@ class ShopModel | ||
498 | $result = array(); | 506 | $result = array(); |
499 | 507 | ||
500 | $article = GuangListData::article('1,2,3', 0, 0, '', 0, $tag, '', 3); | 508 | $article = GuangListData::article('1,2,3', 0, 0, '', 0, $tag, '', 3); |
501 | - if (!isset($article['data']['list']['artList'])) { | 509 | + if (empty($article['data']['list']['artList'])) { |
502 | return $result; | 510 | return $result; |
503 | } | 511 | } |
504 | 512 |
-
Please register or login to post a comment