...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
use Action\WebAction;
|
|
|
use LibModels\Web\Product\BrandData;
|
|
|
use LibModels\Web\Product\FavoriteData;
|
|
|
use Product\BrandsModel;
|
|
|
|
|
|
use LibModels\Web\Product\HotrankData;
|
|
|
use product\HotrankModel;
|
...
|
...
|
@@ -13,29 +14,24 @@ class IndexController extends WebAction |
|
|
*/
|
|
|
public function brandAction()
|
|
|
{
|
|
|
//品牌域名
|
|
|
//品牌域名,没有获取到品牌域名的跳转首页
|
|
|
$domain = $this->param('named');
|
|
|
if (empty($domain)) {
|
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
|
|
$uid = $this->getUid();
|
|
|
//根据品牌域名获取品牌id(同时判断品牌域名是否有效)
|
|
|
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
|
|
|
$fields = 'id,brand_name,brand_name_cn,brand_name_en,brand_domain,brand_alif,brand_banner,brand_ico,static_content_code';
|
|
|
$brandInfo = BrandData::getBrandLogoByDomain($domain, $fields);
|
|
|
|
|
|
if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
|
|
|
$brandId = $brandInfo['data']['id'];
|
|
|
$node = isset($brandInfo['data']['static_content_code']) ? $brandInfo['data']['static_content_code'] : false;
|
|
|
$brandBanner = $brandInfo['data']['brand_banner'];
|
|
|
$brandNameEn = $brandInfo['data']['brand_name_en'];
|
|
|
$brandNameCn = $brandInfo['data']['brand_name_cn'];
|
|
|
} else {
|
|
|
$result = BrandsModel::getBrandByDomain($domain, $fields);
|
|
|
if (!$result) {
|
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
//品牌ID参数
|
|
|
//获取uid
|
|
|
$uid = $this->getUid();
|
|
|
|
|
|
//传品牌ID参数
|
|
|
$condition = array();
|
|
|
$condition['brand'] = $brandId;
|
|
|
$condition['brand'] = isset($result['brandId']) ? $result['brandId'] : '';
|
|
|
|
|
|
//品牌系列参数
|
|
|
$folderId = $this->get('folder_id');
|
...
|
...
|
@@ -45,15 +41,15 @@ class IndexController extends WebAction |
|
|
$options = array();
|
|
|
$options['brandName'] = $domain;
|
|
|
$options['uid'] = $uid;
|
|
|
$options['brandId'] = $brandId;
|
|
|
$options['node'] = $node;
|
|
|
$options['brandBanner'] = $brandBanner;
|
|
|
$options['brandNameEn'] = $brandNameEn;
|
|
|
$options['brandNameCn'] = $brandNameCn;
|
|
|
$options['brandId'] = isset($result['brandId']) ? $result['brandId'] : '';
|
|
|
$options['node'] = isset($result['node']) ? $result['node'] : '';
|
|
|
$options['brandBanner'] = isset($result['brandBanner']) ? $result['brandBanner'] : '';
|
|
|
$options['brandNameEn'] = isset($result['brandNameEn']) ? $result['brandNameEn'] : '';
|
|
|
$options['brandNameCn'] = isset($result['brandNameCn']) ? $result['brandNameCn'] : '';
|
|
|
$options['reviewNum'] = 6;
|
|
|
|
|
|
//调用模型获得数据
|
|
|
$data = Product\BrandsModel::getBrandSearchData($condition, $options);
|
|
|
$data = BrandsModel::getBrandSearchData($condition, $options);
|
|
|
|
|
|
$data = array(
|
|
|
//初始化js
|
...
|
...
|
@@ -75,29 +71,26 @@ class IndexController extends WebAction |
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
|
|
$uid = $this->getUid();
|
|
|
//根据品牌域名获取品牌id(同时判断品牌域名是否有效)
|
|
|
$fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';
|
|
|
$brandInfo = BrandData::getBrandLogoByDomain($domain, $fields);
|
|
|
|
|
|
if (!empty($brandInfo['data']) && $brandInfo['code'] == 200) {
|
|
|
$brandId = $brandInfo['data']['id'];
|
|
|
$brandBanner = $brandInfo['data']['brand_banner'];
|
|
|
$brandAbout = $brandInfo['data']['brand_intro'];
|
|
|
} else {
|
|
|
|
|
|
//根据品牌域名获取品牌id(同时判断品牌域名是否有效),无效跳转首页
|
|
|
$fields = 'id,brand_name,brand_name_cn,brand_banner,brand_ico,brand_intro';
|
|
|
$result = BrandsModel::getBrandByDomain($domain, $fields);
|
|
|
if (!$result) {
|
|
|
$this->go(SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
//品牌ID参数
|
|
|
$condition = array();
|
|
|
$condition['brand'] = $brandId;
|
|
|
$condition['brand'] = isset($result['brandId']) ? $result['brandId'] : '';
|
|
|
|
|
|
//$options参数数组
|
|
|
$options = array();
|
|
|
$options['brandName'] = $domain;
|
|
|
$options['uid'] = $uid;
|
|
|
$options['brandId'] = $brandId;
|
|
|
$options['brandBanner'] = $brandBanner;
|
|
|
$options['brandAbout'] = $brandAbout;
|
|
|
$options['brandId'] = isset($result['brandId']) ? $result['brandId'] : '';
|
|
|
$options['brandBanner'] = isset($result['brandBanner']) ? $result['brandBanner'] : '';
|
|
|
$options['brandAbout'] = isset($result['brandAbout']) ? $result['brandAbout'] : '';
|
|
|
//调用模型获得数据
|
|
|
$data = Product\BrandsModel::getBrandIntro($condition, $options);
|
|
|
|
...
|
...
|
|