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
郝肖肖
9 years ago
Commit
bf84173065344a733635da1b43ebd98ff9a1246a
1 parent
1ac18b1a
店铺装修 列表 新品
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
13 deletions
library/WebPlugin/HelperSearch.php
template/www.yohobuy.com/partials/product/shop-header.phtml
yohobuy/www.yohobuy.com/application/models/Product/Search.php
yohobuy/www.yohobuy.com/application/models/Product/Shop.php
library/WebPlugin/HelperSearch.php
View file @
bf84173
...
...
@@ -177,8 +177,15 @@ class HelperSearch
self
::
setSearchNav
(
$data
[
'product'
][
'total'
]);
}
//品牌店铺信息
if
(
isset
(
$data
[
'shop'
])
&&
!
empty
(
$data
[
'shop'
])
&&
isset
(
$data
[
'shopSort'
]))
{
$result
[
'shopEntry'
]
=
self
::
shop
(
$data
[
'shop'
],
$data
[
'shopSort'
]);
if
(
isset
(
$data
[
'shopData'
])
&&
!
empty
(
$data
[
'shopData'
]))
{
$result
[
'shopEntry'
]
=
array
();
foreach
(
$data
[
'shopData'
]
as
$val
)
{
$shopSort
=
self
::
shop
(
$val
[
'shop'
],
$val
[
'shopSort'
]);
if
(
empty
(
$shopSort
))
{
continue
;
}
$result
[
'shopEntry'
][]
=
$shopSort
;
}
}
//分页
if
(
isset
(
$result
[
'totalCount'
]))
{
...
...
@@ -307,6 +314,11 @@ class HelperSearch
$isNew
=
false
;
$isSale
=
false
;
}
if
(
isset
(
$options
[
'isNew'
])
&&
$options
[
'isNew'
])
{
$isNew
=
true
;
}
//SALE、NEW标签不共存
if
(
$isNew
)
{
$isSale
=
false
;
...
...
@@ -323,7 +335,7 @@ class HelperSearch
'name'
=>
$val
[
'product_name'
],
'salePrice'
=>
$val
[
'sales_price'
],
'brand'
=>
array
(
'url'
=>
Helpers
::
url
(
''
,
''
,
$val
[
'brand_domain'
]
),
'url'
=>
Helpers
::
url
(
''
,
''
,
isset
(
$val
[
'brand_domain'
])
?
$val
[
'brand_domain'
]
:
''
),
'name'
=>
$val
[
'brand_name'
]
),
'isFew'
=>
$isFew
,
...
...
@@ -1426,7 +1438,7 @@ class HelperSearch
public static function shop(
$shop
,
$shopSort
)
{
$shopEntry
= array();
if (self::
$total
== 0) {
if (self::
$total
== 0
|| empty(
$shopSort
)
) {
return
$shopEntry
;
}
$url
= Helpers::url('', '',
$shop['brand_domain']
);
...
...
@@ -1446,6 +1458,7 @@ class HelperSearch
$sort
[] =
$sortInfo
;
}
}
$shop['brand_ico']
= strstr(
$shop['brand_ico']
, '?', true);
$shopEntry['home']
=
$url
;
$shopEntry['logo']
= Images::getImageUrl(
$shop['brand_ico']
, 80, 50, 1, 'brandLogo');
$shopEntry['shopName']
=
$shop['brand_name']
;
...
...
template/www.yohobuy.com/partials/product/shop-header.phtml
View file @
bf84173
{
{#
shopTopBanner
}
}
<div
class=
"shop-banner"
>
<div
class=
"banner-img"
style=
"height: {{bannerHeight}}px;background: url({{banner}})"
></div>
{
{#if
shopsTyp
e
}
}
{
{#if
isShowShopNam
e
}
}
<div
class=
"shop-name"
>
{
{brandName
}
}
{
{brand
Intro.brand
Name
}
}
</div>
{
{/if
}
}
<div
class=
"opt-wrap"
>
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
bf84173
...
...
@@ -45,6 +45,7 @@ class SearchModel
$data
=
array
();
/* 过滤请求参数 */
$condition
=
filter_input_array
(
INPUT_GET
,
array
(
'navBar'
=>
FILTER_VALIDATE_INT
,
'query'
=>
FILTER_FLAG_NO_ENCODE_QUOTES
,
'keyword'
=>
FILTER_FLAG_NO_ENCODE_QUOTES
,
'brand'
=>
FILTER_SANITIZE_STRING
,
...
...
@@ -235,10 +236,15 @@ class SearchModel
$data
=
Yohobuy
::
getMulti
(
$urlList
);
//获取品牌商品分类
if
(
isset
(
$data
[
'shop'
])
&&
!
empty
(
$data
[
'shop'
]))
{
$shopSortParam
[
'brand'
]
=
$data
[
'shop'
][
'id'
];
$shopSort
=
SearchData
::
getClassesData
(
$shopSortParam
);
if
(
isset
(
$shopSort
[
'code'
])
&&
$shopSort
[
'code'
]
==
200
)
{
$data
[
'shopSort'
]
=
$shopSort
[
'data'
][
'sort'
];
$data
[
'shopData'
]
=
array
();
$shopsByBrands
=
SearchData
::
getQueryShopsByBrandId
(
$data
[
'shop'
][
'id'
]);
if
(
!
empty
(
$shopsByBrands
[
'data'
])
&&
is_array
(
$shopsByBrands
[
'data'
]))
{
foreach
(
$shopsByBrands
[
'data'
]
as
$val
)
{
$shopSort
=
SearchData
::
getClassesData
(
array
(
'brand'
=>
$val
[
'brand_id'
]));
if
(
isset
(
$shopSort
[
'code'
])
&&
$shopSort
[
'code'
]
==
200
)
{
$data
[
'shopData'
][]
=
array
(
'shop'
=>
$val
,
'shopSort'
=>
$shopSort
[
'data'
][
'sort'
]);
}
}
}
}
// 组织模板数据
...
...
yohobuy/www.yohobuy.com/application/models/Product/Shop.php
View file @
bf84173
...
...
@@ -245,13 +245,21 @@ class ShopModel
{
$result
=
array
(
'banner'
=>
''
,
'isShowShopName'
=>
false
,
'bannerHeight'
=>
150
);
if
(
isset
(
$data
[
'resource_data'
][
0
][
'shopSrc'
]))
{
$result
[
'banner'
]
=
self
::
imageView2
(
$data
[
'resource_data'
][
0
][
'shopSrc'
],
1150
,
150
);
}
if
(
isset
(
$data
[
'resource_data'
][
0
][
'detailSrc'
]))
{
$result
[
'detailSrc'
]
=
self
::
imageView2
(
$data
[
'resource_data'
][
0
][
'detailSrc'
],
1150
,
150
);
}
if
(
isset
(
$data
[
'resource_data'
][
0
][
'isShowShopName'
]))
{
$result
[
'isShowShopName'
]
=
$data
[
'resource_data'
][
0
][
'isShowShopName'
]
===
'Y'
;
}
return
$result
;
}
...
...
@@ -498,7 +506,7 @@ class ShopModel
$result
=
array
();
$article
=
GuangListData
::
article
(
'1,2,3'
,
0
,
0
,
''
,
0
,
$tag
,
''
,
3
);
if
(
!
isset
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
if
(
empty
(
$article
[
'data'
][
'list'
][
'artList'
]))
{
return
$result
;
}
...
...
Please
register
or
login
to post a comment