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
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
a3177f2c5a477cbbb50b29ad8568e573249397e9
2 parents
5a31e382
e69e0bb9
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy.git
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
66 additions
and
9 deletions
library/Plugin/HelperSearch.php
template/www.yohobuy.com/partials/layout/analysis.phtml
yohobuy/www.yohobuy.com/application/Bootstrap.php
yohobuy/www.yohobuy.com/application/models/Product/Index.php
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
library/Plugin/HelperSearch.php
View file @
a3177f2
...
...
@@ -1316,15 +1316,13 @@ class HelperSearch
*/
public static function getBannerFormat(
$banner
,
$brand
)
{
// 根据品牌Id获取品牌banner图
if (isset(
$banner['banner']
)) {
$bannerImg
= Helpers::getImageUrl(
$banner['banner']
, '', 150);
}
$is_favorite
= false;
$shopName
= false;
if(isset(
$brand
)){
if(isset(
$brand['is_favorite']
)){
// 获取是否收藏
if (
$brand['is_favorite']
== 'Y') {
$is_favorite
= true;
...
...
template/www.yohobuy.com/partials/layout/analysis.phtml
View file @
a3177f2
...
...
@@ -32,9 +32,9 @@ var _hmt = _hmt || [];
})();
}
if (window.addEventListener) {
window.addEventListener(
type
, async_load, false);
window.addEventListener(
'load'
, async_load, false);
} else if (window.attachEvent) {
window.attachEvent(
"on" + type
, async_load);
window.attachEvent(
'onload'
, async_load);
}
})();
</script>
...
...
yohobuy/www.yohobuy.com/application/Bootstrap.php
View file @
a3177f2
...
...
@@ -71,7 +71,7 @@ class Bootstrap extends Bootstrap_Abstract
$controller
=
'Index'
;
$action
=
'Index'
;
// 二级域名
if
(
2
===
$level
)
{
if
(
3
===
$level
)
{
$subDomain
=
strval
(
$hostParts
[
0
]);
switch
(
strtolower
(
$subDomain
))
{
case
'www'
:
// 主站
...
...
yohobuy/www.yohobuy.com/application/models/Product/Index.php
0 → 100644
View file @
a3177f2
<?php
namespace
Product
;
use
Plugin\HelperSearch
;
use
Product\SearchModel
;
use
Api\Yohobuy
;
/**
* list Index页模板数据模型
*
*/
class
IndexModel
{
const
URI_INDEX_TBANNER
=
'/shops/service/v1/searchbanner'
;
public
static
function
getIndexData
(
$customCondition
,
$customOptions
)
{
$urlList
=
array
();
$searchCondition
=
SearchModel
::
searchCondition
(
$customCondition
,
$customOptions
);
// 组合搜索商品url
$urlList
[
'product'
]
=
HelperSearch
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
HelperSearch
::
getClassesUrl
(
$searchCondition
[
'condition'
]);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
//批量调接口获取数据
$result
=
Yohobuy
::
getMulti
(
$urlList
,
array
(),
true
);
//调用接口获取list-index banner数据
$msort
=
isset
(
$searchCondition
[
'condition'
][
'msort'
])
?
$searchCondition
[
'condition'
][
'msort'
]
:
false
;
$misort
=
isset
(
$searchCondition
[
'condition'
][
'misort'
])
?
$searchCondition
[
'condition'
][
'misort'
]
:
false
;
$gender
=
$searchCondition
[
'condition'
][
'gender'
]
==
'2,3'
?
2
:
1
;
if
(
$msort
&&
$misort
)
{
$bannerData
=
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URI_INDEX_TBANNER
,
'get'
,
array
(
10
,
$msort
,
$misort
,
$gender
,
0
,
0
,
0
,
0
,
0
));
}
// 组织模板数据
$data
=
HelperSearch
::
getList
(
$result
,
$searchCondition
[
'options'
]);
return
$data
;
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Sale.php
View file @
a3177f2
...
...
@@ -43,7 +43,6 @@ class SaleModel
}
$special
=
$specialInfo
[
'data'
];
}
//Sale首页 banner数据
$data
[
'saleBanner'
][
'bannerHeight'
]
=
$special
[
'banner'
][
0
][
'height'
];
$data
[
'saleBanner'
][
'img'
]
=
$special
[
'banner'
][
0
][
'img'
];
...
...
@@ -51,8 +50,10 @@ class SaleModel
$data
[
'saleTitle'
][
'count'
]
=
$data
[
'totalCount'
];
//获取广告位数据
$nodeContent
=
HelperSearch
::
formatNodeContent
(
$special
[
'left_ad_code'
]);
$data
[
'leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
if
(
isset
(
$special
[
'left_ad_code'
]))
{
$nodeContent
=
HelperSearch
::
formatNodeContent
(
$special
[
'left_ad_code'
]);
$data
[
'leftContent'
][][
'picLink'
][
'list'
]
=
$nodeContent
;
}
return
$data
;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
a3177f2
...
...
@@ -5,7 +5,17 @@ class ListController extends WebAction
{
public
function
indexAction
()
{
$condition
=
array
();
$options
=
array
();
$indexData
=
Product\IndexModel
::
getIndexData
(
$condition
,
$options
);
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
'list'
=>
$indexData
);
$this
->
setWebNavHeader
();
$this
->
_view
->
display
(
'list'
,
$data
);
}
/**
...
...
Please
register
or
login
to post a comment