Authored by 郝肖肖

店铺装修 列表 新品

... ... @@ -177,8 +177,15 @@ class HelperSearch
self::setSearchNav($data['product']['total']);
}
//品牌店铺信息
if (isset($data['shop']) && !empty($data['shop']) && isset($data['shopSort'])) {
$result['shopEntry'] = self::shop($data['shop'], $data['shopSort']);
if (isset($data['shopData']) && !empty($data['shopData'])) {
$result['shopEntry'] = array();
foreach ($data['shopData'] as $val) {
$shopSort = self::shop($val['shop'], $val['shopSort']);
if (empty($shopSort)) {
continue;
}
$result['shopEntry'][] = $shopSort;
}
}
//分页
if (isset($result['totalCount'])) {
... ... @@ -307,6 +314,11 @@ class HelperSearch
$isNew = false;
$isSale = false;
}
if (isset($options['isNew']) && $options['isNew']) {
$isNew = true;
}
//SALE、NEW标签不共存
if ($isNew) {
$isSale = false;
... ... @@ -323,7 +335,7 @@ class HelperSearch
'name' => $val['product_name'],
'salePrice' => $val['sales_price'],
'brand' => array(
'url' => Helpers::url('', '', $val['brand_domain']),
'url' => Helpers::url('', '', isset($val['brand_domain']) ? $val['brand_domain'] : ''),
'name' => $val['brand_name']
),
'isFew' => $isFew,
... ... @@ -1426,7 +1438,7 @@ class HelperSearch
public static function shop($shop, $shopSort)
{
$shopEntry = array();
if (self::$total == 0) {
if (self::$total == 0 || empty($shopSort)) {
return $shopEntry;
}
$url = Helpers::url('', '', $shop['brand_domain']);
... ... @@ -1446,6 +1458,7 @@ class HelperSearch
$sort[] = $sortInfo;
}
}
$shop['brand_ico'] = strstr($shop['brand_ico'], '?', true);
$shopEntry['home'] = $url;
$shopEntry['logo'] = Images::getImageUrl($shop['brand_ico'], 80, 50, 1, 'brandLogo');
$shopEntry['shopName'] = $shop['brand_name'];
... ...
{{# shopTopBanner}}
<div class="shop-banner">
<div class="banner-img" style="height: {{bannerHeight}}px;background: url({{banner}})"></div>
{{#if shopsType}}
{{#if isShowShopName}}
<div class="shop-name">
{{brandName}}
{{brandIntro.brandName}}
</div>
{{/if}}
<div class="opt-wrap">
... ...
... ... @@ -45,6 +45,7 @@ class SearchModel
$data = array();
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'navBar' => FILTER_VALIDATE_INT,
'query' => FILTER_FLAG_NO_ENCODE_QUOTES ,
'keyword' => FILTER_FLAG_NO_ENCODE_QUOTES ,
'brand' => FILTER_SANITIZE_STRING,
... ... @@ -235,10 +236,15 @@ class SearchModel
$data = Yohobuy::getMulti($urlList);
//获取品牌商品分类
if (isset($data['shop']) && !empty($data['shop'])) {
$shopSortParam['brand'] = $data['shop']['id'];
$shopSort = SearchData::getClassesData($shopSortParam);
if (isset($shopSort['code']) && $shopSort['code'] == 200) {
$data['shopSort'] = $shopSort['data']['sort'];
$data['shopData'] = array();
$shopsByBrands = SearchData::getQueryShopsByBrandId($data['shop']['id']);
if (!empty($shopsByBrands['data']) && is_array($shopsByBrands['data'])) {
foreach ($shopsByBrands['data'] as $val) {
$shopSort = SearchData::getClassesData(array('brand' => $val['brand_id']));
if (isset($shopSort['code']) && $shopSort['code'] == 200) {
$data['shopData'][] = array('shop' => $val, 'shopSort' => $shopSort['data']['sort']);
}
}
}
}
// 组织模板数据
... ...
... ... @@ -245,13 +245,21 @@ class ShopModel
{
$result = array(
'banner' => '',
'isShowShopName' => false,
'bannerHeight' => 150
);
if (isset($data['resource_data'][0]['shopSrc'])) {
$result['banner'] = self::imageView2($data['resource_data'][0]['shopSrc'], 1150, 150);
}
if (isset($data['resource_data'][0]['detailSrc'])) {
$result['detailSrc'] = self::imageView2($data['resource_data'][0]['detailSrc'], 1150, 150);
}
if (isset($data['resource_data'][0]['isShowShopName'])) {
$result['isShowShopName'] = $data['resource_data'][0]['isShowShopName'] === 'Y';
}
return $result;
}
... ... @@ -498,7 +506,7 @@ class ShopModel
$result = array();
$article = GuangListData::article('1,2,3', 0, 0, '', 0, $tag, '', 3);
if (!isset($article['data']['list']['artList'])) {
if (empty($article['data']['list']['artList'])) {
return $result;
}
... ...