Authored by 郭成尧

品牌一览Banner通过资源码配置

... ... @@ -30,10 +30,11 @@ class BrandModel
/**
* 根据频道获取品牌一览数据
*
* @param $code 资源码
* @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
* @return array
*/
public static function getBrandByChannel($channel)
public static function getBrandByChannel($code,$channel)
{
$result = array();
$brand = array();
... ... @@ -56,21 +57,23 @@ class BrandModel
$channels[$channel-1]['active'] = true;
$result['channels'] = $channels;
// tar modified 通过资源位获取数据
/* 根据频道调用接口 */
switch (intval($channel)) {
case 1: // 男生
$brand = BrandData::package(self::CODE_TOPPOS_BOYS, 1);
break;
case 2: // 女生
$brand = BrandData::package(self::CODE_TOPPOS_GIRLS, 2);
break;
case 3: // 潮童
$brand = BrandData::package(self::CODE_TOPPOS_KIDS, 3);
break;
case 4: // 创意生活
$brand = BrandData::package(self::CODE_TOPPOS_LIFESTYLE, 4);
break;
}
// switch (intval($channel)) {
// case 1: // 男生
// $brand = BrandData::package(self::CODE_TOPPOS_BOYS, 1);
// break;
// case 2: // 女生
// $brand = BrandData::package(self::CODE_TOPPOS_GIRLS, 2);
// break;
// case 3: // 潮童
// $brand = BrandData::package(self::CODE_TOPPOS_KIDS, 3);
// break;
// case 4: // 创意生活
// $brand = BrandData::package(self::CODE_TOPPOS_LIFESTYLE, 4);
// break;
// }
$brand = BrandData::package($code, intval($channel));
// 模板中的使用JS标识
$result['brandPage'] = true;
... ...
... ... @@ -18,7 +18,7 @@ class BrandController extends AbstractAction
public function indexAction()
{
$this->setTitle('品牌一览');
$this->setNavHeader('品牌一览', '/boys?go=1&t=' . time(), false);
$this->setNavHeader('品牌一览', '/boys?go=1&t=' . time(), true);
/* 判断参数是否有效 */
$channel = null;
... ... @@ -39,11 +39,15 @@ class BrandController extends AbstractAction
$channel = 1;
}
}
// $code = $this->get('code');
// tar test 1505061525
$code = 'ce6ac059493ec26241a8cbe0bfa1b17a';
$channel = Category\BrandModel::getBrandByChannel($code,$channel);
// \Plugin\DataProcess\CouponFloorProcess::debugOut($channel);
// 渲染模板
$this->_view->display('index', array(
'brandPage' => true,
'channel' => Category\BrandModel::getBrandByChannel($channel)
'channel' => $channel
));
}
... ...