|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use LibModels\Wap\Guang\PlusstarData;
|
|
|
use Plugin\Helpers;
|
|
|
|
|
|
/**
|
|
|
* 明星品牌和原创品牌
|
|
|
*/
|
|
|
class PlusstarController extends AbstractAction
|
|
|
{
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 品牌列表页
|
|
|
*
|
|
|
* @param int gender "1,3"表示男, "2,3"表示女
|
|
|
*/
|
|
|
public function listAction()
|
|
|
{
|
|
|
$data = array(
|
|
|
'star' => array(
|
|
|
array(
|
|
|
'imgs' => array(
|
|
|
array(
|
|
|
'url' => 'http://stussy.m.yohobuy.com',
|
|
|
'img' => 'http://ad.yoho.cn/yohobuy/newfestival/img/brandsmap/6KTZ_01.jpg'
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://stussy.m.yohobuy.com',
|
|
|
'img' =>'http://ad.yoho.cn/yohobuy/newfestival/img/brandsmap/5HUF_01.jpg'
|
|
|
)
|
|
|
)
|
|
|
),
|
|
|
array(
|
|
|
'url' => 'http://stussy.m.yohobuy.com',
|
|
|
'img' => 'http://ad.yoho.cn/yohobuy/newfestival/img/brandsmap/4STAYREAL_02.jpg',
|
|
|
'deps' => '优秀的自助品牌,高瞻远瞩的建设性意见来测试文字溢出后的处理问题'
|
|
|
)
|
|
|
),
|
|
|
'plus' => array(
|
|
|
)
|
|
|
);
|
|
|
$this->_view->assign('title', 'YOHO!有货');
|
|
|
$this->_view->display('list', array('test' => 'hello world'));
|
|
|
|
|
|
$test = PlusstarData::brandList("1,3", 1);
|
|
|
var_dump($test);
|
|
|
$data = array('ps' => array('star' => array(), 'plus' => array()));
|
|
|
|
|
|
$brandList = array();
|
|
|
$build = array();
|
|
|
$imgs = array();
|
|
|
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
// 女
|
|
|
if ($gender === '2,3') {
|
|
|
$brandList = PlusstarData::brandList('2,3', 2);
|
|
|
}
|
|
|
// 男
|
|
|
else {
|
|
|
$brandList = PlusstarData::brandList('1,3', 1);
|
|
|
}
|
|
|
|
|
|
// 明星品牌列表
|
|
|
if (!empty($brandList['star']['data']['list'][0]['data'])) {
|
|
|
foreach ($brandList['star']['data']['list'][0]['data'] as $star) {
|
|
|
$imgs = array();
|
|
|
$build = array();
|
|
|
|
|
|
// 情况1: 多张图
|
|
|
if (isset($star['data'][1])) {
|
|
|
foreach ($star['data'] as $value) {
|
|
|
$build['url'] = $value['url'];
|
|
|
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
|
|
|
$imgs[] = $build;
|
|
|
}
|
|
|
$data['ps']['star'][] = array('imgs' => $imgs);
|
|
|
}
|
|
|
// 情况2: 单张图
|
|
|
elseif (isset($star['data'][0])) {
|
|
|
$build['url'] = $star['data'][0]['url'];
|
|
|
$build['img'] = $star['data'][0]['src'];
|
|
|
$data['ps']['star'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 原创品牌列表
|
|
|
if (!empty($brandList['original']['data']['list'][0]['data'])) {
|
|
|
foreach ($brandList['original']['data']['list'][0]['data'] as $original) {
|
|
|
$imgs = array();
|
|
|
$build = array();
|
|
|
|
|
|
// 情况1: 多张图
|
|
|
if (isset($original['data'][1])) {
|
|
|
foreach ($original['data'] as $value) {
|
|
|
$build['url'] = $value['url'];
|
|
|
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
|
|
|
$build['deps'] = $original['brand_title'];
|
|
|
$imgs[] = $build;
|
|
|
}
|
|
|
$data['ps']['plus'][] = array('imgs' => $imgs);
|
|
|
}
|
|
|
// 情况2: 单张图
|
|
|
elseif (isset($original['data'][0])) {
|
|
|
$build['url'] = $original['data'][0]['url'];
|
|
|
$build['img'] = Helpers::getImageUrl($original['data'][0]['src'], 640, 310);
|
|
|
$build['deps'] = $original['brand_title'];
|
|
|
$data['ps']['plus'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
|
|
|
$brandList = array();
|
|
|
$data = array();
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 品牌介绍页
|
|
|
*/
|
|
|
public function detailAction()
|
|
|
{
|
|
|
$id = $this->get('id');
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
|
|
|
|
|
|
$test = PlusstarData::brandInfo(67, '1,3', 123456);
|
|
|
var_dump($test);
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
|
|
|
|
|
} |
...
|
...
|
|