Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
a808b2d42789b87f4ed6060b29d8340884ac3490
1 parent
046cb7de
compact with the old station url access rule, and configure the sub domain eg gu…
…ang,list,search,brands...
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
245 deletions
library/LibModels/Wap/Category/BrandData.php
yohobuy/m.yohobuy.com/application/models/Category/Brand.php
yohobuy/m.yohobuy.com/application/modules/Category/controllers/Brand.php
yohobuy/m.yohobuy.com/configs/routes.index.ini
library/LibModels/Wap/Category/BrandData.php
View file @
a808b2d
...
...
@@ -44,7 +44,7 @@ class BrandData
$param
[
'method'
]
=
'app.brand.brandlist'
;
$param
[
'yh_channel'
]
=
$channel
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
$urlList
[
'brandList'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$param
);
$urlList
[
'brandList'
]
=
Yohobuy
::
httpBuildQuery
(
Yohobuy
::
API_URL
,
$param
,
3600
);
// 有缓存1小时
return
Yohobuy
::
getMulti
(
$urlList
);
}
...
...
yohobuy/m.yohobuy.com/application/models/Category/Brand.php
View file @
a808b2d
...
...
@@ -53,6 +53,9 @@ class BrandModel
break
;
}
// 模板中的使用JS标识
$result
[
'brandPage'
]
=
true
;
/* 顶部的轮翻广告列表 */
if
(
!
empty
(
$brand
[
'brandTop'
][
0
][
'data'
]))
{
$build
=
array
();
...
...
yohobuy/m.yohobuy.com/application/modules/Category/controllers/Brand.php
View file @
a808b2d
<?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
}
...
...
yohobuy/m.yohobuy.com/configs/routes.index.ini
View file @
a808b2d
...
...
@@ -55,10 +55,17 @@ routes.emailback.route.controller = Back
routes.emailback.route.action
=
Email
; 所有品类
routes.reg.type
=
"rewrite"
routes.reg.match
=
"/cate"
routes.reg.route.module
=
Category
routes.reg.route.controller
=
Class
routes.reg.route.action
=
Index
routes.cate.type
=
"rewrite"
routes.cate.match
=
"/cate"
routes.cate.route.module
=
Category
routes.cate.route.controller
=
Class
routes.cate.route.action
=
Index
; 品牌一览
routes.brands.type
=
"rewrite"
routes.brands.match
=
"/brands"
routes.brands.route.module
=
Category
routes.brands.route.controller
=
Brand
routes.brands.route.action
=
Index
...
...
Please
register
or
login
to post a comment