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
Plain Diff
Browse Files
Authored by
xuqi
9 years ago
Commit
792eb85bf77a7497aa37791f088ff7085538b292
2 parents
30258a48
fa9a2361
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
15 deletions
library/WebPlugin/HelperSearch.php
web-static/sass/home/_index-pliffy.scss
yohobuy/www.yohobuy.com/application/models/Product/New.php
library/WebPlugin/HelperSearch.php
View file @
792eb85
...
...
@@ -191,19 +191,19 @@ class HelperSearch
$isSale
=
false
;
}
$gender
=
0
;
if
(
isset
(
self
::
$options
[
'gender'
]))
{
$genderArr
=
explode
(
','
,
self
::
$options
[
'gender'
]);
if
(
isset
(
self
::
$params
[
'gender'
]))
{
$genderArr
=
explode
(
','
,
self
::
$params
[
'gender'
]);
$gender
=
$genderArr
[
0
];
}
foreach
(
$val
[
'goods_list'
]
as
$k
=>
$v
){
$goods_list
[
$k
][
'url'
]
=
Helpers
::
getUrlBySkc
(
$val
[
'product_id'
],
$v
[
'goods_id'
],
$val
[
'cn_alphabet'
]);
//女封
if
(
isset
(
$v
[
'cover_1'
])
&&
$gender
==
1
)
{
$val
[
'default_images'
]
=
$v
[
'images_url'
];
}
//男封
if
(
isset
(
$v
[
'cover_2'
])
&&
$gender
==
2
)
{
$val
[
'default_images'
]
=
$v
[
'images_url'
];
if
(
isset
(
$v
[
'cover_1'
])
&&
!
empty
(
$v
[
'cover_1'
])
&&
$gender
==
1
)
{
$val
[
'default_images'
]
=
$v
[
'cover_1'
];
}
//女封
if
(
isset
(
$v
[
'cover_2'
])
&&
!
empty
(
$v
[
'cover_2'
])
&&
$gender
==
2
)
{
$val
[
'default_images'
]
=
$v
[
'cover_2'
];
}
//筛选符合颜色条件的封面图片
if
(
isset
(
$params
[
'color'
])
&&
$params
[
'color'
]
==
$v
[
'color_id'
])
{
...
...
@@ -232,6 +232,10 @@ class HelperSearch
'thumb'
=>
$val
[
'default_images'
],
'name'
=>
$val
[
'product_name'
],
'salePrice'
=>
$val
[
'sales_price'
],
'brand'
=>
array
(
'url'
=>
Helpers
::
url
(
''
,
''
,
$val
[
'brand_domain'
]),
'name'
=>
$val
[
'brand_name'
]
),
'isFew'
=>
$isFew
,
'skn'
=>
$val
[
'product_skn'
],
'showColBtn'
=>
true
,
...
...
@@ -492,7 +496,7 @@ class HelperSearch
$existName
[]
=
$v
[
'brand_name'
];
}
if
(
$existBrandNum
===
1
){
$existName
[]
=
substr
(
$v
[
'brand_name'
],
0
,
3
)
.
'...'
;
$existName
[]
=
substr
(
$v
[
'brand_name'
],
0
,
4
)
.
'...'
;
}
$existBrandNum
++
;
}
...
...
@@ -547,9 +551,30 @@ class HelperSearch
if
(
self
::
checkSearch
(
'brand'
))
{
return
array
();
}
//品牌数量小于等于10,隐藏更多按钮
$result
[
'showMulti'
]
=
count
(
$result
[
'brandsShow'
])
>
1
?
true
:
false
;
$result
[
'showMore'
]
=
count
(
$result
[
'brandsShow'
])
>
10
?
true
:
false
;
//品牌数量等于1,设置为已选中
$totalBrand
=
count
(
$result
[
'brandsShow'
]);
if
(
$totalBrand
==
1
)
{
if
(
!
in_array
(
$totalBrand
,
$brandIds
))
{
//设置已选中
self
::
$selected
[
'brand'
]
=
array
(
'name'
=>
$result
[
'brandsShow'
][
0
][
'name'
],
'href'
=>
self
::
buildUrl
(
$params
,
array
(
'brand'
,
$result
[
'brandsShow'
][
0
][
'href'
]))
);
$result
[
'default'
][
0
][
'checked'
]
=
true
;
}
if
(
self
::
$options
[
'controller'
]
==
'Search'
)
{
return
array
();
}
}
//品牌数量大于1小于10,显示多选
elseif
(
$totalBrand
>
1
&&
$totalBrand
<
10
)
{
$result
[
'showMulti'
]
=
true
;
}
//品牌数量大于10,显示多选、更多按钮
else
{
$result
[
'showMulti'
]
=
true
;
$result
[
'showMore'
]
=
true
;
}
return
$result
;
}
/**
...
...
@@ -1380,7 +1405,12 @@ class HelperSearch
$action
= isset(self::
$options['action']
) ? strtolower(self::
$options['action']
) : '';
//列表页面
if (
$controller
== 'list' &&
$action
== 'index') {
$type
= isset(self::
$params['msort']
) && self::
$params['msort']
? self::
$params['msort']
: '';
if (isset(self::
$params['misort']
)) {
$type
= self::
$params['misort']
;
}
elseif (isset(self::
$params['msort']
)) {
$type
= self::
$params['msort']
;
}
}
//新品到着
elseif (
$controller
== 'list' &&
$action
== 'new') {
...
...
web-static/sass/home/_index-pliffy.scss
View file @
792eb85
...
...
@@ -120,7 +120,7 @@
}
.tpl-brands
{
width
:
378px
;
height
:
5
04
px
;
height
:
5
12
px
;
li
a
{
height
:
248px
;
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/New.php
View file @
792eb85
...
...
@@ -21,7 +21,7 @@ class NewModel
// 组合搜索商品url
$urlList
[
'product'
]
=
SearchData
::
getProductUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索分类url
$urlList
[
'sort'
]
=
SearchData
::
getClassesUrl
(
$searchCondition
[
'sortCondition'
]
);
$urlList
[
'sort'
]
=
SearchData
::
getClassesUrl
();
// 组合搜索最新上架url
$urlList
[
'recent'
]
=
SearchData
::
getRecentShelveUrl
(
$searchCondition
[
'condition'
]);
...
...
Please
register
or
login
to post a comment