Index.php
1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
use Action\WebAction;
use LibModels\Web\Product\BrandData;
class IndexController extends WebAction
{
/**
* 品牌首页
*/
public function brandAction()
{
//品牌域名
$domain = $this->param('named');
if (empty($domain)) {
$this->go(SITE_MAIN);
}
$uid = $this->getUid();
//根据品牌域名获取品牌id(同时判断品牌域名是否有效)
$brandInfo = BrandData::getBrandLogoByDomain($domain);
if (!empty($brandInfo['data']) && $brandInfo['code'] === 200) {
$brandId = $brandInfo['data']['id'];
$node = isset($brandInfo['static_content_code']) ? $brandInfo['static_content_code'] : false;
} else {
$this->go(SITE_MAIN);
}
//品牌ID参数
$condition = array();
$condition['brand'] = $brandId;
//$options参数数组
$options = array();
$options['brandName'] = $domain;
$options['uid'] = $uid;
$options['brandId'] = $brandId;
$options['node'] = $node;
//调用模型获得数据
$data = Product\BrandsModel::getBrandSearchData($condition, $options);
$data = array(
//初始化js
'searchListPage' => true,
'list' => $data
);
$this->setWebNavHeader();
//渲染模板
$this->_view->display('list',$data);
}
}
?>