...
|
...
|
@@ -11,82 +11,39 @@ class PlusstarController extends AbstractAction |
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 品牌列表页
|
|
|
* 国际精选-品牌列表页
|
|
|
*
|
|
|
* @param int gender "1,3"表示男, "2,3"表示女
|
|
|
*/
|
|
|
public function listAction()
|
|
|
public function indexAction()
|
|
|
{
|
|
|
$data = array('psList' => true, 'ps' => array('star' => array(), 'plus' => array()));
|
|
|
|
|
|
$brandList = array();
|
|
|
$build = array();
|
|
|
$imgs = array();
|
|
|
$this->setTitle('国际优选');
|
|
|
$this->setNavHeader('国际优选', true, SITE_MAIN);
|
|
|
|
|
|
$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'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
|
|
|
$imgs[] = $build;
|
|
|
}
|
|
|
$data['ps']['star'][] = array('imgs' => $imgs);
|
|
|
}
|
|
|
// 情况2: 单张图
|
|
|
elseif (isset($star['data'][0])) {
|
|
|
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($star['data'][0]['src'], 640, 310);
|
|
|
$data['ps']['star'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$data = Guang\PlusstarModel::getFirstBrands($gender);
|
|
|
$data['psList'] = true; // 控制模板中的JS使用
|
|
|
|
|
|
// 原创品牌列表
|
|
|
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'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
|
|
|
$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'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($original['data'][0]['src'], 640, 310);
|
|
|
$build['deps'] = $original['brand_title'];
|
|
|
$data['ps']['plus'][] = $build;
|
|
|
}
|
|
|
}
|
|
|
$this->_view->display('index', $data);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
/**
|
|
|
* 明星原创-品牌列表页
|
|
|
*
|
|
|
* @param int gender "1,3"表示男, "2,3"表示女
|
|
|
*/
|
|
|
public function listAction()
|
|
|
{
|
|
|
$this->setTitle('明星原创');
|
|
|
$this->setNavHeader('明星原创', true, SITE_MAIN);
|
|
|
|
|
|
$brandList = array();
|
|
|
$data = array();
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
|
|
|
$data = Guang\PlusstarModel::getBrands($gender);
|
|
|
$data['psList'] = true; // 控制模板中的JS使用
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -120,7 +77,7 @@ class PlusstarController extends AbstractAction |
|
|
$data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name'];
|
|
|
$data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
|
|
|
$data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}";
|
|
|
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' ') );
|
|
|
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' '));
|
|
|
$data['ps']['newArrival'] = array();
|
|
|
$data['ps']['newArrival']['moreUrl'] = ''; // @todo 品牌列表页面
|
|
|
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
|
...
|
...
|
@@ -136,7 +93,6 @@ class PlusstarController extends AbstractAction |
|
|
}
|
|
|
|
|
|
$brandInfo = array();
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
if (array() === $data) {
|
...
|
...
|
|