do category brand page
Showing
15 changed files
with
232 additions
and
141 deletions
framework @ 75bbc3b0
@@ -296,17 +296,17 @@ class AbstractAction extends Controller_Abstract | @@ -296,17 +296,17 @@ class AbstractAction extends Controller_Abstract | ||
296 | /** | 296 | /** |
297 | * 设置网站导航头部信息 | 297 | * 设置网站导航头部信息 |
298 | * | 298 | * |
299 | - * @param string $backUrl 返回的链接 | ||
300 | * @param string $title 头部标题 | 299 | * @param string $title 头部标题 |
300 | + * @param string $backUrl 返回的链接 | ||
301 | * @param string $homeUrl 返回首页的链接 | 301 | * @param string $homeUrl 返回首页的链接 |
302 | * @return void | 302 | * @return void |
303 | */ | 303 | */ |
304 | - protected function setNavHeader($backUrl, $title, $homeUrl) | 304 | + protected function setNavHeader($title = '', $backUrl = true, $homeUrl = '/') |
305 | { | 305 | { |
306 | $header = array(); | 306 | $header = array(); |
307 | 307 | ||
308 | - if (!empty($backUrl)) { | ||
309 | - $header['navBack'] = $backUrl; | 308 | + if ($backUrl) { |
309 | + $header['navBack'] = true; | ||
310 | } | 310 | } |
311 | if (!empty($title)) { | 311 | if (!empty($title)) { |
312 | $header['navTitle'] = $title; | 312 | $header['navTitle'] = $title; |
@@ -16,12 +16,43 @@ use Api\Sign; | @@ -16,12 +16,43 @@ use Api\Sign; | ||
16 | */ | 16 | */ |
17 | class BrandData | 17 | class BrandData |
18 | { | 18 | { |
19 | + const URI_BRAND_TOPPOS = 'operations/api/v5/resource/get'; | ||
20 | + | ||
21 | + /** | ||
22 | + * 封装获取品牌一览页面的数据 | ||
23 | + * | ||
24 | + * @param string $contentCode 获取广告资源需要的位置码 | ||
25 | + * @param int $channel 频道标识 1:男,2:女,3:潮童,4:创意生活 | ||
26 | + * @return array( | ||
27 | + * "brandTop": "顶部的轮翻广告及热门品牌数据", | ||
28 | + * "brandList": "按字母'A-Z'分组的品牌列表数据" | ||
29 | + * ) | ||
30 | + * @author fei.hong <fei.hong@yoho.cn> | ||
31 | + */ | ||
32 | + public static function package($contentCode, $channel) | ||
33 | + { | ||
34 | + $urlList = array(); | ||
35 | + | ||
36 | + /* 顶部的轮翻广告及热门品牌数据 */ | ||
37 | + $param = Yohobuy::param(); | ||
38 | + $param['content_code'] = $contentCode; | ||
39 | + $param['client_secret'] = Sign::getSign($param); | ||
40 | + $urlList['brandTop'] = Yohobuy::httpBuildQuery(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); | ||
41 | + | ||
42 | + /* 按字母"A-Z"分组的品牌列表数据 */ | ||
43 | + $param = Yohobuy::param(); | ||
44 | + $param['method'] = 'app.brand.brandlist'; | ||
45 | + $param['yh_channel'] = $channel; | ||
46 | + $param['client_secret'] = Sign::getSign($param); | ||
47 | + $urlList['brandList'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param); | ||
48 | + | ||
49 | + return Yohobuy::getMulti($urlList); | ||
50 | + } | ||
19 | 51 | ||
20 | /** | 52 | /** |
21 | * 获取品牌数据 | 53 | * 获取品牌数据 |
22 | * | 54 | * |
23 | * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据 | 55 | * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据 |
24 | - * | ||
25 | * @return array 品牌数据 | 56 | * @return array 品牌数据 |
26 | */ | 57 | */ |
27 | public static function getBrandsData($channel = 1) | 58 | public static function getBrandsData($channel = 1) |
@@ -38,16 +69,17 @@ class BrandData | @@ -38,16 +69,17 @@ class BrandData | ||
38 | /** | 69 | /** |
39 | * 获取品牌页顶部楼层数据 | 70 | * 获取品牌页顶部楼层数据 |
40 | * | 71 | * |
72 | + * @param string $contentCode 位置码 | ||
41 | * @return array 品牌也顶部楼层数据 | 73 | * @return array 品牌也顶部楼层数据 |
42 | */ | 74 | */ |
43 | - public static function getBrandTopData() | 75 | + public static function getBrandTopData($contentCode) |
44 | { | 76 | { |
45 | // 构建必传参数 | 77 | // 构建必传参数 |
46 | $param = Yohobuy::param(); | 78 | $param = Yohobuy::param(); |
47 | - $param['content_code'] = 'ce6ac059493ec26241a8cbe0bfa1b17a'; | 79 | + $param['content_code'] = $contentCode; |
48 | $param['client_secret'] = Sign::getSign($param); | 80 | $param['client_secret'] = Sign::getSign($param); |
49 | 81 | ||
50 | - return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/get', $param); | 82 | + return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_BRAND_TOPPOS, $param); |
51 | } | 83 | } |
52 | 84 | ||
53 | /** | 85 | /** |
@@ -10,15 +10,26 @@ class Helpers | @@ -10,15 +10,26 @@ class Helpers | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * 根据尺寸获得图片url | 12 | * 根据尺寸获得图片url |
13 | - * @param string $fileName 文件名 | 13 | + * @param string $url 路径 |
14 | * @param integer $width 图片宽度 | 14 | * @param integer $width 图片宽度 |
15 | * @param integer $height 图片高度 | 15 | * @param integer $height 图片高度 |
16 | * @param integer $mode 模式 | 16 | * @param integer $mode 模式 |
17 | * @return string 图片地址 | 17 | * @return string 图片地址 |
18 | */ | 18 | */ |
19 | - public static function getImageUrl($fileName, $width, $height, $mode = 2) | 19 | + public static function getImageUrl($url, $width, $height, $mode = 2) |
20 | { | 20 | { |
21 | - return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)); | 21 | + return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode)); |
22 | + } | ||
23 | + | ||
24 | + /** | ||
25 | + * 获取过滤后的URL链接 | ||
26 | + * | ||
27 | + * @param string $url 路径 | ||
28 | + * @return string 去除掉如&openby:yohobuy={"action":"go.brand"}这样的APP附加参数 | ||
29 | + */ | ||
30 | + public static function getFilterUrl($url) | ||
31 | + { | ||
32 | + return strstr($url, '&openby:yohobuy=', true); | ||
22 | } | 33 | } |
23 | 34 | ||
24 | /** | 35 | /** |
@@ -13,6 +13,9 @@ class BoysController extends AbstractAction | @@ -13,6 +13,9 @@ class BoysController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_BOYS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('男生首页'); | 20 | $this->setTitle('男生首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -13,6 +13,9 @@ class GirlsController extends AbstractAction | @@ -13,6 +13,9 @@ class GirlsController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_GIRLS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('女生首页'); | 20 | $this->setTitle('女生首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -26,7 +29,6 @@ class GirlsController extends AbstractAction | @@ -26,7 +29,6 @@ class GirlsController extends AbstractAction | ||
26 | 'maybeLike' => true, | 29 | 'maybeLike' => true, |
27 | 'content' => Index\HomeModel::getGirlsFloor() | 30 | 'content' => Index\HomeModel::getGirlsFloor() |
28 | )); | 31 | )); |
29 | - | ||
30 | } | 32 | } |
31 | 33 | ||
32 | } | 34 | } |
@@ -13,6 +13,10 @@ class IndexController extends AbstractAction | @@ -13,6 +13,10 @@ class IndexController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页 | ||
17 | + Index\HomeModel::goSwitchChannel(); | ||
18 | + | ||
19 | + // 渲染模板 | ||
16 | $this->_view->display('index', array( | 20 | $this->_view->display('index', array( |
17 | 'background' => Index\HomeModel::getBgImage() | 21 | 'background' => Index\HomeModel::getBgImage() |
18 | )); | 22 | )); |
@@ -13,6 +13,9 @@ class KidsController extends AbstractAction | @@ -13,6 +13,9 @@ class KidsController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_KIDS); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('潮童首页'); | 20 | $this->setTitle('潮童首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -26,7 +29,6 @@ class KidsController extends AbstractAction | @@ -26,7 +29,6 @@ class KidsController extends AbstractAction | ||
26 | 'maybeLike' => true, | 29 | 'maybeLike' => true, |
27 | 'content' => Index\HomeModel::getKidsFloor() | 30 | 'content' => Index\HomeModel::getKidsFloor() |
28 | )); | 31 | )); |
29 | - | ||
30 | } | 32 | } |
31 | 33 | ||
32 | } | 34 | } |
@@ -13,6 +13,9 @@ class LifestyleController extends AbstractAction | @@ -13,6 +13,9 @@ class LifestyleController extends AbstractAction | ||
13 | */ | 13 | */ |
14 | public function indexAction() | 14 | public function indexAction() |
15 | { | 15 | { |
16 | + // 设置COOKIE标识用户访问过该页面了 | ||
17 | + Index\HomeModel::setSwitchToCookie(Index\HomeModel::COOKIE_NAME_LIFESTYLE); | ||
18 | + | ||
16 | // 设置网站标题 | 19 | // 设置网站标题 |
17 | $this->setTitle('创意生活首页'); | 20 | $this->setTitle('创意生活首页'); |
18 | // 显示侧边栏 | 21 | // 显示侧边栏 |
@@ -26,7 +29,6 @@ class LifestyleController extends AbstractAction | @@ -26,7 +29,6 @@ class LifestyleController extends AbstractAction | ||
26 | 'maybeLike' => true, | 29 | 'maybeLike' => true, |
27 | 'content' => Index\HomeModel::getLifestyleFloor() | 30 | 'content' => Index\HomeModel::getLifestyleFloor() |
28 | )); | 31 | )); |
29 | - | ||
30 | } | 32 | } |
31 | 33 | ||
32 | } | 34 | } |
1 | +<?php | ||
2 | + | ||
3 | +namespace Category; | ||
4 | + | ||
5 | +use LibModels\Wap\Category\BrandData; | ||
6 | +use Configs\CacheConfig; | ||
7 | +use Plugin\Helpers; | ||
8 | + | ||
9 | +/** | ||
10 | + * 品牌相关的模板数据模型 | ||
11 | + * | ||
12 | + * @name BrandModel | ||
13 | + * @package Models/Category | ||
14 | + * @copyright yoho.inc | ||
15 | + * @version 1.0 (2015-10-21 13:52:44) | ||
16 | + * @author fei.hong <fei.hong@yoho.cn> | ||
17 | + */ | ||
18 | +class BrandModel | ||
19 | +{ | ||
20 | + /* 男生频道取品牌广告及热门品牌数据的位置码 */ | ||
21 | + const CODE_TOPPOS_BOYS = 'ce6ac059493ec26241a8cbe0bfa1b17a'; | ||
22 | + /* 女生频道取品牌广告及热门品牌数据的位置码 */ | ||
23 | + const CODE_TOPPOS_GIRLS = 'dac99cdedc1f948e84c145aca561f7d2'; | ||
24 | + /* 潮童频道取品牌广告及热门品牌数据的位置码 */ | ||
25 | + const CODE_TOPPOS_KIDS = '713784f93f52bb1a7b93916b2bb15510'; | ||
26 | + /* 创意生活频道取品牌广告及热门品牌数据的位置码 */ | ||
27 | + const CODE_TOPPOS_LIFESTYLE = 'f1aa914fd23cbcda71a87de6f5416c75'; | ||
28 | + | ||
29 | + /** | ||
30 | + * 根据频道获取品牌一览数据 | ||
31 | + * | ||
32 | + * @param int $channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | ||
33 | + * @return array | ||
34 | + */ | ||
35 | + public static function getBrandByChannel($channel) | ||
36 | + { | ||
37 | + | ||
38 | + $result = array(); | ||
39 | + $brand = array(); | ||
40 | + | ||
41 | + /* 根据频道调用接口 */ | ||
42 | + switch (intval($channel)) { | ||
43 | + case 1: // 男生 | ||
44 | + $brand = BrandData::package(self::CODE_TOPPOS_BOYS, 1); | ||
45 | + break; | ||
46 | + case 2: // 女生 | ||
47 | + $brand = BrandData::package(self::CODE_TOPPOS_GIRLS, 2); | ||
48 | + break; | ||
49 | + case 3: // 潮童 | ||
50 | + $brand = BrandData::package(self::CODE_TOPPOS_KIDS, 3); | ||
51 | + break; | ||
52 | + case 4: // 创意生活 | ||
53 | + $brand = BrandData::package(self::CODE_TOPPOS_LIFESTYLE, 4); | ||
54 | + break; | ||
55 | + } | ||
56 | + | ||
57 | + /* 顶部的轮翻广告列表 */ | ||
58 | + if (!empty($brand['brandTop'][0]['data'])) { | ||
59 | + $build = array(); | ||
60 | + foreach ($brand['brandTop'][0]['data'] as $value) { | ||
61 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
62 | + $build['img'] = Helpers::getImageUrl($value['src'], 640, 300); | ||
63 | + $build['title'] = $value['title']; | ||
64 | + $result['bannerTop']['list'][] = $build; | ||
65 | + } | ||
66 | + } | ||
67 | + | ||
68 | + /* 顶部的热门品牌列表 */ | ||
69 | + if (!empty($brand['brandTop'][1]['data']['list'])) { | ||
70 | + $build = array(); | ||
71 | + foreach ($brand['brandTop'][1]['data']['list'] as $value) { | ||
72 | + $build['url'] = Helpers::getFilterUrl($value['url']); | ||
73 | + $build['img'] = Helpers::getImageUrl($value['src'], 144, 144); | ||
74 | + $build['name'] = $value['name']; | ||
75 | + $result['hotBrand']['list'][] = $build; | ||
76 | + } | ||
77 | + } | ||
78 | + | ||
79 | + /* 按字母'A-Z'分组的品牌列表 */ | ||
80 | + if (!empty($brand['brandList']['brands'])) { | ||
81 | + $list = array(); | ||
82 | + $build = array(); | ||
83 | + foreach ($brand['brandList']['brands'] as $char => $value) { | ||
84 | + $build['title'] = $char; | ||
85 | + $build['list'] = array(); | ||
86 | + foreach ($value as $row) { | ||
87 | + $list['name'] = $row['brand_name']; | ||
88 | + $list['isHot'] = ($row['is_hot'] === 'Y') ? true : false; | ||
89 | + $list['isNew'] = ($row['is_show_new'] === 'Y') ? true : false; | ||
90 | + $list['url'] = $row['brand_domain'] . '.' . OLD_DOMAIN; | ||
91 | + $build['list'][] = $list; | ||
92 | + } | ||
93 | + $result['brandList'][] = $build; | ||
94 | + } | ||
95 | + } | ||
96 | + | ||
97 | + $brand = array(); | ||
98 | + | ||
99 | + return $result; | ||
100 | + } | ||
101 | + | ||
102 | +} |
@@ -19,7 +19,6 @@ use Configs\CacheConfig; | @@ -19,7 +19,6 @@ use Configs\CacheConfig; | ||
19 | */ | 19 | */ |
20 | class HomeModel | 20 | class HomeModel |
21 | { | 21 | { |
22 | - | ||
23 | /* 频道选择页取背景图片的位置码 */ | 22 | /* 频道选择页取背景图片的位置码 */ |
24 | const CODE_BG = '7ba9118028f9b22090b57341487567eb'; | 23 | const CODE_BG = '7ba9118028f9b22090b57341487567eb'; |
25 | 24 | ||
@@ -37,6 +36,44 @@ class HomeModel | @@ -37,6 +36,44 @@ class HomeModel | ||
37 | /* 女生底部广告的位置码 */ | 36 | /* 女生底部广告的位置码 */ |
38 | const CODE_BANNER_BOTTOM_GIRLS = '8c8bd1b89a22e5895f05882e0825b493'; | 37 | const CODE_BANNER_BOTTOM_GIRLS = '8c8bd1b89a22e5895f05882e0825b493'; |
39 | 38 | ||
39 | + /* COOKIE标识访问的是男生频道 */ | ||
40 | + const COOKIE_NAME_BOYS = 'boys'; | ||
41 | + /* COOKIE标识访问的是女生频道 */ | ||
42 | + const COOKIE_NAME_GIRLS = 'girls'; | ||
43 | + /* COOKIE标识访问的是潮童频道 */ | ||
44 | + const COOKIE_NAME_KIDS = 'kids'; | ||
45 | + /* COOKIE标识访问的是创意生活频道 */ | ||
46 | + const COOKIE_NAME_LIFESTYLE = 'lifestyle'; | ||
47 | + | ||
48 | + /** | ||
49 | + * 选择频道 | ||
50 | + * | ||
51 | + * @return void | ||
52 | + */ | ||
53 | + public static function goSwitchChannel() | ||
54 | + { | ||
55 | + // 通过COOKIE检查是否已设置过首页频道时,跳转到对应的频道页 | ||
56 | + if (!empty($_COOKIE['_Channel'])) { | ||
57 | + headers_sent() || header('Location: /' . $_COOKIE['_Channel']); | ||
58 | + exit(); | ||
59 | + } | ||
60 | + // 没有Cookie时, 设置默认访问的频道 | ||
61 | + else { | ||
62 | + self::setSwitchToCookie(self::COOKIE_NAME_BOYS); | ||
63 | + } | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * 设置选择的频道保存到浏览器COOKIE | ||
68 | + * | ||
69 | + * @param string $cookie | ||
70 | + * @return void | ||
71 | + */ | ||
72 | + public static function setSwitchToCookie($cookie) | ||
73 | + { | ||
74 | + setcookie('_Channel', $cookie, time() + 86400 * 300, '/', '.' . SITE_DOMAIN); | ||
75 | + } | ||
76 | + | ||
40 | /** | 77 | /** |
41 | * 获取频道选择页的背景图片 | 78 | * 获取频道选择页的背景图片 |
42 | * | 79 | * |
1 | <?php | 1 | <?php |
2 | use Action\AbstractAction; | 2 | use Action\AbstractAction; |
3 | -use LibModels\Wap\Category\BrandData; | ||
4 | 3 | ||
5 | /** | 4 | /** |
6 | - * 品牌 | 5 | + * 品牌相关的控制器 |
7 | */ | 6 | */ |
8 | class BrandController extends AbstractAction | 7 | class BrandController extends AbstractAction |
9 | { | 8 | { |
9 | + /** | ||
10 | + * 品牌一览 | ||
11 | + * | ||
12 | + * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 | ||
13 | + */ | ||
10 | public function indexAction() | 14 | public function indexAction() |
11 | { | 15 | { |
12 | - // 获取品牌数据 | ||
13 | - /*$brandTopData = BrandData::getBrandTopData(); | ||
14 | - $brandsData = BrandData::getBrandsData(); | 16 | + $this->setTitle('品牌一览'); |
17 | + $this->setNavHeader('品牌一览'); | ||
15 | 18 | ||
16 | - $brandTop = array(); | ||
17 | - if($brandTopData['code'] == 200) | ||
18 | - { | ||
19 | - $brandTop = $brandTopData['data']; | 19 | + /* 判断参数是否有效 */ |
20 | + $channel = $this->get('channel', 1); | ||
21 | + if (!is_numeric($channel) || intval($channel) > 4) { | ||
22 | + $channel = 1; | ||
20 | } | 23 | } |
21 | - $brands = array(); | ||
22 | - if($brandsData['code'] == 200) | ||
23 | - { | ||
24 | - $brands = $brandsData['data']; | ||
25 | - } | ||
26 | - | ||
27 | - echo '<pre>'; | ||
28 | - var_dump($brandTop, $brands);exit;*/ | ||
29 | - | ||
30 | - $data = array ( | ||
31 | - 'brandPage' => true, | ||
32 | - 'bannerTop' => array ( | ||
33 | - 'list' => array ( | ||
34 | - array ( | ||
35 | - 'url' => '', | ||
36 | - 'img' => 'http://img10.static.yhbimg.com/adpic/2015/10/15/10/01c161398d3baec2868abe85e26ba1a71d.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90' | ||
37 | - ), | ||
38 | - array ( | ||
39 | - 'url' => '', | ||
40 | - 'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/027c45cdc03e23c367ec0ff3d29b7c3f79.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90' | ||
41 | - ), | ||
42 | - array ( | ||
43 | - 'url' => '', | ||
44 | - 'img' => 'http://img13.static.yhbimg.com/adpic/2015/10/15/10/022e2ac6daa33fc3cb8a0f04025a35994f.jpg?imageMogr2/thumbnail/640x300/extent/640x300/background/d2hpdGU=/position/center/quality/90' | ||
45 | - ) | ||
46 | - ) | ||
47 | - ), | ||
48 | - 'hotBrand' => array ( | ||
49 | - 'list' => array ( | ||
50 | - array ( | ||
51 | - 'url' => '', | ||
52 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/08/12/17/0233d54f34d2534c08271a8fc27090a6af.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
53 | - ), | ||
54 | - array ( | ||
55 | - 'url' => '', | ||
56 | - 'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/020b17265b2103b49005c57395b8b154a9.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
57 | - ), | ||
58 | - array ( | ||
59 | - 'url' => '', | ||
60 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/11/27/09/02b403bdcbfb965bdc632fea5c29816746.png?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
61 | - ), | ||
62 | - array ( | ||
63 | - 'url' => '', | ||
64 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2013/11/01/14/027e68260ba30c01b165c17fe043f2ce2c.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
65 | - ), | ||
66 | - array ( | ||
67 | - 'url' => '', | ||
68 | - 'img' => 'http://img11.static.yhbimg.com/brandLogo/2014/04/25/14/0179fa8eacf51fd1a89ec6f7fdeab88fc2.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
69 | - ), | ||
70 | - array ( | ||
71 | - 'url' => '', | ||
72 | - 'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/01/27/11/02608437f8d8b6b7b15786214b0a5ef502.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
73 | - ), | ||
74 | - array ( | ||
75 | - 'url' => '', | ||
76 | - 'img' => 'http://img12.static.yhbimg.com/brandLogo/2013/02/28/17/020aae69720d683a7962c9b7fd3a92c801.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
77 | - ), | ||
78 | - array ( | ||
79 | - 'url' => '', | ||
80 | - 'img' => 'http://img13.static.yhbimg.com/brandLogo/2014/01/27/11/02bca7ac6414c7475b4a337e28a0365590.jpg?imageMogr2/thumbnail/144x144/extent/144x144/background/d2hpdGU=/position/center/quality/90' | ||
81 | - ) | ||
82 | - ) | ||
83 | - ), | ||
84 | - 'brandList' => array ( | ||
85 | - array ( | ||
86 | - 'title' => '0~9', | ||
87 | - 'list' => array( | ||
88 | - array ( | ||
89 | - 'name' => '004', | ||
90 | - 'isHot' => true | ||
91 | - ), | ||
92 | - array ( | ||
93 | - 'name' => '10*1', | ||
94 | - 'isNew' => true | ||
95 | - ), | ||
96 | - array ( | ||
97 | - 'name' => '2%' | ||
98 | - ) | ||
99 | - ) | ||
100 | - ), | ||
101 | - array ( | ||
102 | - 'title' => 'A', | ||
103 | - 'list' => array( | ||
104 | - array ( | ||
105 | - 'name' => 'Aape', | ||
106 | - 'isHot' => true | ||
107 | - ), | ||
108 | - array ( | ||
109 | - 'name' => 'Adfdfd', | ||
110 | - 'isNew' => true | ||
111 | - ), | ||
112 | - array ( | ||
113 | - 'name' => 'Acrwewwe' | ||
114 | - ) | ||
115 | - ) | ||
116 | - ), | ||
117 | - array ( | ||
118 | - 'title' => 'B', | ||
119 | - 'list' => array( | ||
120 | - array ( | ||
121 | - 'name' => 'Bape' | ||
122 | - ), | ||
123 | - array ( | ||
124 | - 'name' => 'Bdfdfd' | ||
125 | - ), | ||
126 | - array ( | ||
127 | - 'name' => 'Bcrwewwe' | ||
128 | - ) | ||
129 | - ) | ||
130 | - ) | ||
131 | - ) | ||
132 | - | ||
133 | - | ||
134 | - ); | ||
135 | 24 | ||
25 | + /* 获取渲染模板需要的数据 */ | ||
26 | + $data = Category\BrandModel::getBrandByChannel($channel); | ||
27 | + if (!is_array($data)) { | ||
28 | + $data = array(); | ||
29 | + } | ||
30 | + $data['brandPage'] = true; | ||
136 | 31 | ||
137 | - $this->_view->assign('title', 'YOHO!有货'); | ||
138 | - //$this->_view->display('brand', compact('brands')); | ||
139 | $this->_view->display('index', $data); | 32 | $this->_view->display('index', $data); |
140 | } | 33 | } |
141 | } | 34 | } |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'm.dev.yohobuy.com'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', false); // 缓存的开关 | 6 | define('USE_CACHE', false); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'buy.test.yoho.cn'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', true); // 缓存的开关 | 6 | define('USE_CACHE', true); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | use Yaf\Application; | 2 | use Yaf\Application; |
3 | 3 | ||
4 | define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名 | 4 | define('SITE_DOMAIN', 'wap.yohobuy.com'); // 网站主域名 |
5 | +define('OLD_DOMAIN', 'm.yohobuy.com'); // 网站旧域名 | ||
5 | define('USE_CACHE', true); // 缓存的开关 | 6 | define('USE_CACHE', true); // 缓存的开关 |
6 | define('APPLICATION_PATH', dirname(__DIR__)); | 7 | define('APPLICATION_PATH', dirname(__DIR__)); |
7 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); | 8 | define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); |
-
Please register or login to post a comment