Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yangyang
9 years ago
Commit
b4e3145e3df01f3bf877aefc09bdc687c453b485
1 parent
9a2a2a0d
修改众多bug
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
51 deletions
yohobuy/www.yohobuy.com/application/Bootstrap.php
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
yohobuy/www.yohobuy.com/application/Bootstrap.php
View file @
b4e3145
...
...
@@ -73,7 +73,7 @@ class Bootstrap extends Bootstrap_Abstract
$action
=
'Index'
;
// 二级域名
if
(
2
===
$level
)
{
if
(
3
===
$level
)
{
$subDomain
=
strval
(
$hostParts
[
0
]);
switch
(
strtolower
(
$subDomain
))
{
case
'www'
:
// 主站
...
...
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
View file @
b4e3145
...
...
@@ -70,18 +70,14 @@ class BrandsModel {
//获取静态内容(20141219-100447)
if
(
$node
){
$nodeContent
=
BrandData
::
getByNodeContent
(
$node
);
if
(
isset
(
$nodeContent
[
'code'
])
&&
$nodeContent
[
'code'
]
===
200
){
$result
=
$nodeContent
[
'data'
];
//接口返回html格式,非前端需要格式。
}
$nodeContent
=
HelperSearch
::
formatNodeContent
(
$node
);
$data
[
'list'
][
'leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
}
return
$data
;
}
/**
* 获取品牌首页banner条
* @string $domain 品牌域名
...
...
@@ -103,48 +99,26 @@ class BrandsModel {
$intro
=
BrandData
::
getBrandIntro
(
$brandId
,
$uid
);
}
$is_favorite
=
false
;
$logo
=
false
;
$shopName
=
false
;
do
{
if
(
!
isset
(
$intro
[
'data'
]))
{
break
;
}
if
(
isset
(
$intro
[
'data'
])){
// 获取是否收藏
if
(
$intro
[
'data'
][
'is_favorite'
]
==
'Y'
)
{
$is_favorite
=
true
;
}
elseif
(
$intro
[
'data'
][
'is_favorite'
]
==
'N'
)
{
$is_favorite
=
false
;
}
// 获取品牌logo
$logo
=
Helpers
::
getImageUrl
(
$intro
[
'data'
][
'brand_ico'
],
80
,
50
);
// 获取品牌名
self
::
$shopName
=
$intro
[
'data'
][
'brand_name'
];
}
while
(
false
);
self
::
$shopName
=
$intro
[
'data'
][
'brand_name'
];
}
// 返回banner数据
return
array
(
'brandBanner'
=>
array
(
'bannerHeight'
=>
'150'
,
'coled'
=>
$is_favorite
,
'banner'
=>
$bannerImg
),
'shopEntry'
=>
array
(
'home'
=>
self
::
$home
,
'logo'
=>
$logo
,
'shopName'
=>
self
::
$shopName
,
'sort'
=>
array
(
array
(
'href'
=>
''
,
'name'
=>
'T恤'
),
array
(
'href'
=>
''
,
'name'
=>
'卫衣'
)
)
)
);
'brandBanner'
=>
array
(
'bannerHeight'
=>
'150'
,
'coled'
=>
$is_favorite
,
'banner'
=>
$bannerImg
)
);
}
//获取品牌系列数据
...
...
@@ -158,6 +132,8 @@ class BrandsModel {
$result
[
'list'
][
$key
][
'src'
]
=
$value
[
'brand_sort_ico'
];
}
}
$result
[
'picTitle'
]
=
'经典系列'
;
return
$result
;
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
View file @
b4e3145
...
...
@@ -58,10 +58,9 @@ class SaleModel
$data
[
'newSale'
][
'saleTitle'
][
'count'
]
=
$data
[
'newSale'
][
'totalCount'
];
//获取广告位
//获取广告位
数据
$nodeContent
=
HelperSearch
::
formatNodeContent
(
$special
[
'left_ad_code'
]);
$data
[
'newSale'
][
'leftContent'
][][
'picLink'
][]
=
$nodeContent
;
$data
[
'newSale'
][
'leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
return
$data
;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
b4e3145
...
...
@@ -55,6 +55,7 @@ class IndexController extends WebAction
}
//传品牌ID参数
$condition
[
'brand'
]
=
$brandId
;
//获取性别数据
$gender
=
$this
->
get
(
'gender'
)
?
(
$this
->
get
(
'gender'
)
==
'2,3'
?
2
:
1
)
:
(
!
isset
(
$_COOKIE
[
'_Gender'
])
?
'3'
:
(
$_COOKIE
[
'_Gender'
]
==
'2,3'
?
2
:
1
));
$condition
[
'gender'
]
=
$gender
;
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
View file @
b4e3145
...
...
@@ -13,16 +13,14 @@ class SaleController extends WebAction
public
function
indexAction
()
{
//获取专区ID
$specialsaleId
=
$this
->
P
aram
(
'specialsaleId'
);
$specialsaleId
=
$this
->
p
aram
(
'specialsaleId'
);
$specialsaleId
=
1
;
//测试数据
$specialInfo
=
SaleData
::
getSpecial
(
$specialsaleId
);
$special
=
$specialInfo
[
'data'
];
// if (empty($specialsale_id)) {
// $specialsale_id = str_replace('specialsale', '', explode('.', $_SERVER['HTTP_HOST'])[0]);
// }
//获取促销ID
$promotion
=
$this
->
Param
(
'promotion'
);
$promotion
=
$this
->
param
(
'promotion'
);
//专区ID和促销ID都为空时,跳转到主页
if
(
empty
(
$specialsaleId
)
&&
empty
(
$promotion
))
{
$this
->
go
(
SITE_MAIN
);
...
...
@@ -49,7 +47,7 @@ class SaleController extends WebAction
'viewNum'
=>
FILTER_VALIDATE_INT
,
'rowNum'
=>
FILTER_VALIDATE_INT
,
'page'
=>
FILTER_VALIDATE_INT
,),
false
);
//字符转码
if
(
!
empty
(
$condition
))
{
foreach
(
$condition
as
&
$value
)
{
...
...
@@ -64,6 +62,8 @@ class SaleController extends WebAction
//传促销id
if
(
!
empty
(
$special
[
'ispromotion'
])){
//$condition['promotion'] = $special['ispromotion'];
}
else
{
$condition
[
'promotion'
]
=
$promotion
;
}
//获取性别数据
...
...
@@ -73,7 +73,7 @@ class SaleController extends WebAction
//每页显示商品数
if
(
!
isset
(
$condition
[
'viewNum'
])
||
empty
(
$condition
[
'viewNum'
]))
{
$condition
[
'viewNum'
]
=
59
;
}
}
$view_num_arr
=
array
(
60
,
100
,
200
);
if
(
!
in_array
(
$condition
[
'viewNum'
],
$view_num_arr
))
{
$condition
[
'viewNum'
]
=
59
;
...
...
@@ -108,7 +108,6 @@ class SaleController extends WebAction
$params
=
array_filter
(
$params
);
$data
=
Product\SaleModel
::
getSaleSearchData
(
$params
,
$options
,
$specialInfo
);
$cate
=
array
(
'boys'
,
'girls'
,
'kids'
,
'lifestyle'
);
$this
->
setWebNavHeader
(
$cate
[
$gender
-
1
]);
//渲染模板
...
...
Please
register
or
login
to post a comment