...
|
...
|
@@ -3,7 +3,6 @@ namespace Product; |
|
|
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Web\Product\BrandData;
|
|
|
use Product\SearchModel;
|
|
|
|
|
|
/**
|
|
|
* Description of Brands
|
...
|
...
|
@@ -13,9 +12,10 @@ use Product\SearchModel; |
|
|
class BrandsModel
|
|
|
{
|
|
|
|
|
|
const URL_BRAND_INDEX = '/product/brands/index';
|
|
|
const URL_BRAND_INDEX = '/product/index/brand';
|
|
|
|
|
|
public static $shopName;
|
|
|
public static $home;
|
|
|
/**
|
|
|
* 获取品牌首页banner条
|
|
|
* @string $domain 品牌域名
|
...
|
...
|
@@ -27,7 +27,7 @@ class BrandsModel |
|
|
public static function getBannerByDomain($domain, $bannerId, $uid = '')
|
|
|
{
|
|
|
// 构造品牌主页url
|
|
|
$home = Helpers::url('', '', $domain) . self::URL_BRAND_INDEX;
|
|
|
self::$home = Helpers::url('', '', $domain) . self::URL_BRAND_INDEX;
|
|
|
// 根据品牌Id获取品牌banner图
|
|
|
$bannerImg = BrandData::getBrandBanner($bannerId);
|
|
|
if (isset($bannerImg['data'])) {
|
...
|
...
|
@@ -66,7 +66,7 @@ class BrandsModel |
|
|
'banner' => $bannerImg
|
|
|
),
|
|
|
'shopEntry' => array(
|
|
|
'home' => $home,
|
|
|
'home' => self::$home,
|
|
|
'logo' => $logo,
|
|
|
'shopName' => self::$shopName,
|
|
|
'sort' => array(
|
...
|
...
|
@@ -99,6 +99,15 @@ class BrandsModel |
|
|
$classes['brand'] = $condition['brand'];
|
|
|
// 调用商品搜索接口
|
|
|
$data = \Product\SearchModel::getSearchData($condition, $options,$classes);
|
|
|
$advNav = BrandData::getFolderByBrand($condition['brand'],1);
|
|
|
$result = array();
|
|
|
if (isset($advNav['data']) && $advNav['code'] === 200) {
|
|
|
foreach ($advNav['data'] as $key => $value) {
|
|
|
$result['list'][$key]['href'] = self::$home . '?folder=' . $value['id'];
|
|
|
$result['list'][$key]['src'] = $value['brand_sort_ico'];
|
|
|
}
|
|
|
}
|
|
|
$data['list']['advNav'] = $result;
|
|
|
$shopName = self::$shopName;
|
|
|
if(isset($data['list'])){
|
|
|
$arr = array_chunk($data['list']['pathNav'],1);
|
...
|
...
|
@@ -107,6 +116,7 @@ class BrandsModel |
|
|
);
|
|
|
}
|
|
|
$nav = array_merge_recursive($arr[0],$arr[1]);
|
|
|
|
|
|
$data['list']['pathNav'] = $nav;
|
|
|
//删除品牌列表
|
|
|
unset($data['list']['filters']['brand']);
|
...
|
...
|
|