|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -6,257 +7,40 @@ use Action\AbstractAction; |
|
|
*/
|
|
|
class BrandController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 品牌一览
|
|
|
*
|
|
|
* @param string gender 老版本中使用的参数, 做兼容判断
|
|
|
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
|
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
$this->setTitle('品牌一览');
|
|
|
$this->setNavHeader('品牌一览');
|
|
|
|
|
|
|
|
|
/* 判断参数是否有效 */
|
|
|
$channel = $this->get('channel', 1);
|
|
|
if (!is_numeric($channel) || intval($channel) > 4) {
|
|
|
$channel = 1;
|
|
|
$channel = null;
|
|
|
$gender = $this->get('gender');
|
|
|
if (!empty($gender)) {
|
|
|
switch ($gender) {
|
|
|
case '1,3': // 男
|
|
|
$channel = 1;
|
|
|
break;
|
|
|
case '2,3': // 女
|
|
|
$channel = 2;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* 获取渲染模板需要的数据 */
|
|
|
/*$data = Category\BrandModel::getBrandByChannel($channel);
|
|
|
if (!is_array($data)) {
|
|
|
$data = array();
|
|
|
if (!isset($channel)) {
|
|
|
$channel = $this->get('channel', 1);
|
|
|
if (!is_numeric($channel) || intval($channel) > 4) {
|
|
|
$channel = 1;
|
|
|
}
|
|
|
}
|
|
|
$data['brandPage'] = true;
|
|
|
|
|
|
$brandTop = array();
|
|
|
if($brandTopData['code'] == 200)
|
|
|
{
|
|
|
$brandTop = $brandTopData['data'];
|
|
|
}
|
|
|
$brands = array();
|
|
|
if($brandsData['code'] == 200)
|
|
|
{
|
|
|
$brands = $brandsData['data'];
|
|
|
}
|
|
|
|
|
|
/*echo '<pre>';
|
|
|
var_dump($brandTop, $brands);exit;*/
|
|
|
|
|
|
$data = array (
|
|
|
'brandPage' => true,
|
|
|
'pageHeader' => array (
|
|
|
'navBack' => 'sss ',
|
|
|
'navHome' => 'sss ',
|
|
|
'navTitle' => 'sss '
|
|
|
),
|
|
|
'bannerTop' => array (
|
|
|
'list' => array (
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img10.static.yhbimg.com/adpic/2015/10/15/10/01c161398d3baec2868abe85e26ba1a71d.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/027c45cdc03e23c367ec0ff3d29b7c3f79.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/022e2ac6daa33fc3cb8a0f04025a35994f.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
'hotBrand' => array (
|
|
|
'list' => array (
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/08/12/17/0233d54f34d2534c08271a8fc27090a6af.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/020b17265b2103b49005c57395b8b154a9.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/11/27/09/02b403bdcbfb965bdc632fea5c29816746.png?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img13.static.yhbimg.com/brandLogo/2013/11/01/14/027e68260ba30c01b165c17fe043f2ce2c.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img11.static.yhbimg.com/brandLogo/2014/04/25/14/0179fa8eacf51fd1a89ec6f7fdeab88fc2.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/02608437f8d8b6b7b15786214b0a5ef502.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img12.static.yhbimg.com/brandLogo/2013/02/28/17/020aae69720d683a7962c9b7fd3a92c801.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
),
|
|
|
array (
|
|
|
'url' => '',
|
|
|
'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/01/27/11/02bca7ac6414c7475b4a337e28a0365590.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
'brandList' => array (
|
|
|
array (
|
|
|
'title' => '0~9',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => '004',
|
|
|
'isHot' => true
|
|
|
),
|
|
|
array (
|
|
|
'name' => '10*1',
|
|
|
'isNew' => true
|
|
|
),
|
|
|
array (
|
|
|
'name' => '2%'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'A',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Aape',
|
|
|
'isHot' => true
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Adfdfd',
|
|
|
'isNew' => true
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Acrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array (
|
|
|
'title' => 'B',
|
|
|
'list' => array(
|
|
|
array (
|
|
|
'name' => 'Bape'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bdfdfd'
|
|
|
),
|
|
|
array (
|
|
|
'name' => 'Bcrwewwe'
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
//$this->_view->display('brand', compact('brands'));
|
|
|
|
|
|
// 渲染模板
|
|
|
$this->_view->display('index', $data);
|
|
|
$this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
|
|
|
|
|
} |
...
|
...
|
|