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
yyq
9 years ago
Commit
93857ccda0be26bb21c4fa2d233fd2be2bca8762
1 parent
93f09da8
code找回
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
10 deletions
library/WebPlugin/HelperSearch.php
template/www.yohobuy.com/actions/product/index/shop-index.phtml
template/www.yohobuy.com/actions/product/index/shop-list.phtml
yohobuy/www.yohobuy.com/application/models/Product/Shop.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
library/WebPlugin/HelperSearch.php
View file @
93857cc
...
...
@@ -220,7 +220,11 @@ class HelperSearch
return
array
();
}
$gender
=
isset
(
self
::
$params
[
'gender'
])
?
self
::
$params
[
'gender'
]
:
Helpers
::
getGenderByCookie
();
$gender
=
substr
(
$gender
,
0
,
1
);
if
(
$options
[
'defaultCover'
]
&&
$gender
===
'1,2,3'
)
{
$gender
=
0
;
}
else
{
$gender
=
substr
(
$gender
,
0
,
1
);
}
foreach
(
$product
as
$key
=>
$val
){
if
(
!
isset
(
$val
[
'goods_list'
])
||
empty
(
$val
[
'goods_list'
]))
{
continue
;
...
...
template/www.yohobuy.com/actions/product/index/shop-index.phtml
View file @
93857cc
...
...
@@ -9,7 +9,7 @@
<div
class=
"shop-search"
>
<form
action=
"//search.yohobuy.com"
method=
"get"
id=
"shop-search-form"
>
<span>
<input
type=
"hidden"
name=
"shop"
value=
"{{shopId}}"
>
<input
type=
"hidden"
name=
"shop
Id
"
value=
"{{shopId}}"
>
<input
id=
"shop-query-key"
type=
"text"
name=
"query"
class=
"shop-query-key"
autocomplete=
"off"
x-webkit-speech=
""
lang=
"zh-CN"
placeholder=
"关键词搜索"
>
</span>
<span
class=
"iconfont shop-query-submit"
>
611
;</span>
...
...
template/www.yohobuy.com/actions/product/index/shop-list.phtml
View file @
93857cc
...
...
@@ -6,6 +6,15 @@
{
{>
product/shop-header
}
}
<div
class=
"list-left pull-left"
>
<div
class=
"shop-search"
>
<form
action=
"/shoplist"
method=
"get"
id=
"shop-search-form"
>
<span>
<input
type=
"hidden"
name=
"shopId"
value=
"{{shopId}}"
>
<input
id=
"shop-query-key"
type=
"text"
name=
"query"
class=
"shop-query-key"
autocomplete=
"off"
x-webkit-speech=
""
lang=
"zh-CN"
placeholder=
"关键词搜索"
>
</span>
<span
class=
"iconfont shop-query-submit"
>
611
;</span>
</form>
</div>
{
{>
product/left-content
}
}
{
{>
product/shop-sidebar
}
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Shop.php
View file @
93857cc
...
...
@@ -80,18 +80,23 @@ class ShopModel
if
(
isset
(
$sknProList
[
'data'
][
'product_list'
]))
{
$coverList
=
array
();
foreach
(
$sknProList
[
'data'
][
'product_list'
]
as
$prod
)
{
$coverList
[
$prod
[
'product_skn'
]]
=
HelperSearch
::
getProductPic
(
array
(
0
=>
$prod
));
$proList
=
HelperSearch
::
getProductList
(
$sknProList
[
'data'
][
'product_list'
],
array
(
'imgSize'
=>
array
(
250
,
250
),
'defaultCover'
=>
true
));
foreach
(
$proList
as
$prod
)
{
$coverList
[
$prod
[
'skn'
]]
=
$prod
[
'thumb'
];
}
foreach
(
$data
[
'newArrivel'
][
'list'
]
as
$k
=>
$v
)
{
foreach
(
$data
[
'newArrivel'
][
'list'
]
as
&
$v
)
{
if
(
isset
(
$coverList
[
$v
[
'product_skn'
]]))
{
$
data
[
'newArrivel'
][
'list'
][
$k
][
'img'
]
=
$coverList
[
$v
[
'product_skn'
]][
0
][
'coverImg'
];
$
v
[
'img'
]
=
$coverList
[
$v
[
'product_skn'
]
];
}
}
foreach
(
$data
[
'hotSingle'
][
'list'
]
as
$k
=>
$v
)
{
foreach
(
$data
[
'hotSingle'
][
'list'
]
as
&
$v
)
{
if
(
isset
(
$coverList
[
$v
[
'product_skn'
]]))
{
$
data
[
'hotSingle'
][
'list'
][
$k
][
'img'
]
=
$coverList
[
$v
[
'product_skn'
]][
0
][
'coverImg'
];
$
v
[
'img'
]
=
$coverList
[
$v
[
'product_skn'
]
];
}
}
}
...
...
@@ -122,7 +127,11 @@ class ShopModel
}
// 组织模板数据
$result
=
HelperSearch
::
getList
(
$res
,
$searchCondition
[
'options'
],
$searchCondition
[
'userInput'
]);
$result
=
HelperSearch
::
getList
(
$res
,
array_merge
(
array
(
'defaultCover'
=>
true
),
$searchCondition
[
'options'
]
),
$searchCondition
[
'userInput'
]);
$data
[
'pathNav'
]
=
array_merge
(
HelperSearch
::
$listNav
,
array
(
...
...
@@ -204,7 +213,10 @@ class ShopModel
}
// 组织模板数据
$result
=
HelperSearch
::
getList
(
$res
,
$searchCondition
[
'options'
],
$searchCondition
[
'userInput'
]);
$result
=
HelperSearch
::
getList
(
$res
,
array_merge
(
array
(
'defaultCover'
=>
true
),
$searchCondition
[
'options'
]
),
$searchCondition
[
'userInput'
]);
$data
[
'goods'
]
=
$result
[
'goods'
];
$data
[
'opts'
]
=
$result
[
'opts'
];
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
93857cc
...
...
@@ -541,6 +541,7 @@ class IndexController extends WebAction
$data
=
array_merge
(
array
(
'shopIndexPage'
=>
true
,
'shopId'
=>
$shopId
,
'pathNav'
=>
false
,
// pathNav数据结构同其他页面
'coupon'
=>
false
,
// 先不做
),
...
...
Please
register
or
login
to post a comment