...
|
...
|
@@ -7,6 +7,7 @@ use Plugin\HelperSearch; |
|
|
use LibModels\Web\Product\BrandData;
|
|
|
use Index\HomeModel;
|
|
|
use Product\SearchModel;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
/**
|
|
|
* 品牌首页模板数据模型
|
...
|
...
|
@@ -80,7 +81,7 @@ class BrandsModel |
|
|
$urlList['product'] = HelperSearch::getProductUrl($searchCondition['condition']);
|
|
|
|
|
|
// 组合搜索分类url
|
|
|
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['condition']);
|
|
|
$urlList['sort'] = HelperSearch::getClassesUrl($searchCondition['sortCondition']);
|
|
|
|
|
|
//组合搜索品牌url
|
|
|
$urlList['brand'] = HelperSearch::getBrandUrl($customOptions);
|
...
|
...
|
@@ -108,32 +109,41 @@ class BrandsModel |
|
|
{
|
|
|
$switchParams = self::switchBrandParams($channel);
|
|
|
$brandTop = array();
|
|
|
/*
|
|
|
* $item1 = array(
|
|
|
'name' => '所有品牌',
|
|
|
'src' => $imgsrc,
|
|
|
'url' => ''
|
|
|
);
|
|
|
*/
|
|
|
$brandAds = array();
|
|
|
$brandList = array();
|
|
|
$res = BrandData::getTopBanner($switchParams['brandCode'], $switchParams['channelType']);
|
|
|
//头部10个品牌图块
|
|
|
if (isset($res['brandTop'][1]['data']['list']) && $res['brandTop'][1]['data']['list']) {
|
|
|
foreach ($res['brandTop'][1]['data']['list'] as $tbk => $tbv) {
|
|
|
$imgUrlTmp = explode("?", $tbv['src']);
|
|
|
$urlTmp = explode("?", $tbv['url']);
|
|
|
$topBrandTmp = array(
|
|
|
'name' => $tbv['name'],
|
|
|
'src' => Helpers::getImageUrl($imgUrlTmp[0], 80, 50, 3),
|
|
|
'url' => str_replace('m.', '', $urlTmp[0]),
|
|
|
);
|
|
|
$brandAds[$tbk] = $topBrandTmp;
|
|
|
}
|
|
|
}
|
|
|
//头部品牌图块
|
|
|
if (isset($res['brandTop'][0]['data']) && $res['brandTop'][0]['data']) {
|
|
|
foreach ($res['brandTop'][0]['data'] as $tk => $tv) {
|
|
|
$imgUrl = explode("?", $tv['src']);
|
|
|
$imgUrlTmp = explode("?", $tv['src']);
|
|
|
$urlTmp = explode("?", $tv['url']);
|
|
|
$topTmp = array(
|
|
|
'name' => $tv['title'],
|
|
|
'src' => $imgUrl[0],
|
|
|
'url' => $tv['url'],
|
|
|
'items' => array()
|
|
|
'src' => $imgUrlTmp[0],
|
|
|
'url' => $urlTmp[0],
|
|
|
'items' => $brandAds
|
|
|
);
|
|
|
$brandTop[$tk] = $topTmp;
|
|
|
}
|
|
|
}
|
|
|
//品牌list
|
|
|
if (isset($res['brandList']['brands']) && $res['brandList']['brands']) {
|
|
|
foreach ($res['brandList']['brands'] as $lk => $lv) {
|
|
|
$listTmp = array();
|
|
|
if (isset($lv) && $lv) {
|
|
|
$listTmp = array();
|
|
|
foreach ($lv as $ltk => $ltv) {
|
|
|
$listTmp[$ltk] = array(
|
|
|
'name' => $ltv['brand_name'],
|
...
|
...
|
@@ -158,33 +168,20 @@ class BrandsModel |
|
|
*/
|
|
|
public static function getBrandInfo($brandId, $uid)
|
|
|
{
|
|
|
$imgsrc = 'http://img11.static.yhbimg.com/goodsimg/2015/10/19/10/01b312c3b7a7efebcd671e73495ff3e306.jpg';
|
|
|
$data = array(
|
|
|
'key' => '1000011',
|
|
|
'icon' => $imgsrc,
|
|
|
'title' => '优显led触控台灯',
|
|
|
'content' => '优显led触控台灯优显led触控台灯优显led触控台灯优显led触控台灯',
|
|
|
'subtitle' => 'AAAAAA',
|
|
|
'imgs' => array(
|
|
|
array(
|
|
|
'src' => $imgsrc
|
|
|
),
|
|
|
array(
|
|
|
'src' => $imgsrc
|
|
|
),
|
|
|
array(
|
|
|
'src' => $imgsrc
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
$data = array();
|
|
|
$res = BrandData::getBrandIntro($brandId, $uid);
|
|
|
//if(isset($res['data']) && $res['data']){
|
|
|
// $data['key']=$brandId;
|
|
|
// $data['icon']=
|
|
|
//}
|
|
|
var_dump($res);
|
|
|
die();
|
|
|
|
|
|
if (isset($res['data']) && $res['data']) {
|
|
|
$icoUrlTmp = explode("?", $res['data']['brand_ico']) ;
|
|
|
$data = array(
|
|
|
'key' => $res['data']['brand_id'],
|
|
|
'icon' => $icoUrlTmp[0],
|
|
|
'title' => $res['data']['brand_name'],
|
|
|
'content' =>$res['data']['brand_intro'],
|
|
|
'subtitle' => 'FEATURED ITEMS',
|
|
|
'imgs' => array(),
|
|
|
);
|
|
|
}
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
/*
|
...
|
...
|
|