Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
8 years ago
Commit
d851a10abd9e98522a74c2d856e23959753e5eac
1 parent
f21cd602
router
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
33 deletions
apps/product/models/search.js
apps/product/router.js
doraemon/middleware/htaccess/rules/www.js
apps/product/models/search.js
View file @
d851a10
...
...
@@ -412,27 +412,6 @@ exports.getSearchKeywordData = (params, channel) => {
*/
exports
.
getSearchKeywordDataById
=
(
id
,
params
,
channel
)
=>
{
return
co
(
function
*
()
{
let
searchParams
=
searchHandler
.
getSearchParams
(
params
);
switch
(
channel
)
{
case
'boys'
:
searchParams
.
physical_channel
=
1
;
break
;
case
'girls'
:
searchParams
.
physical_channel
=
2
;
break
;
case
'kids'
:
searchParams
.
physical_channel
=
3
;
break
;
case
'lifestyle'
:
searchParams
.
physical_channel
=
4
;
break
;
default
:
break
;
}
searchParams
.
need_filter
=
'no'
;
let
redisData
=
yield
redis
.
all
([
[
'get'
,
`
golobal
:
yoho
:
seo
:
keywords
:
id
:
$
{
id
}
`
]
]);
...
...
@@ -444,17 +423,11 @@ exports.getSearchKeywordDataById = (id, params, channel) => {
redisData
=
JSON
.
parse
(
redisData
[
0
]);
searchParams
.
query
=
redisData
.
name
;
let
result
=
yield
api
.
all
([
headerModel
.
requestHeaderData
(
channel
),
searchApi
.
getSuggest
({
keyword
:
searchParams
.
query
.
substring
(
0
,
2
)}),
searchApi
.
getProductList
(
searchParams
,
'fuzzySearch'
)
]);
params
.
query
=
redisData
.
name
;
let
resData
=
setSearchKeywordData
(
result
,
params
,
channel
);
let
resData
=
yield
this
.
getSearchKeywordData
(
params
,
channel
);
resData
.
queryKey
=
searchP
arams
.
query
;
resData
.
queryKey
=
p
arams
.
query
;
if
(
!
_
.
isEmpty
(
redisData
.
data
))
{
_
.
forEach
(
redisData
.
data
,
value
=>
{
...
...
apps/product/router.js
View file @
d851a10
...
...
@@ -103,7 +103,7 @@ router.get('/api/suggest', search.suggest4Old);
router
.
get
(
'/search/history'
,
search
.
searchHistory
);
// 搜索历史提示
router
.
get
(
'/search/less/recommend'
,
search
.
searchLessRecommend
);
// 搜索少或无 有可能喜欢
router
.
get
(
'/search/keyword/:id'
,
search
.
keyword
);
router
.
get
(
'/search/canpin/:id'
,
search
.
keyId
);
router
.
get
(
'/search/c
h
anpin/:id'
,
search
.
keyId
);
// 商品分类列表页
router
.
get
(
'/list/index'
,
gbk2utf
,
list
.
index
);
...
...
doraemon/middleware/htaccess/rules/www.js
View file @
d851a10
...
...
@@ -80,8 +80,8 @@ module.exports = [
// 推荐词id列表页
{
type
:
TYPE
.
rewrite
,
origin
:
/^
\/
canpin
\/(
.*
)\.
html
(
.*
)
/
,
target
:
(
req
,
match
,
p1
)
=>
`
/
product
/
search
/
canpin
/
$
{
p1
}
`
origin
:
/^
\/
chanpin
\/(
.*
)\.
html
(
.*
)
/
,
target
:
(
req
,
match
,
p1
)
=>
`
/
product
/
search
/
chanpin
/
$
{
p1
}
`
},
// erp2good
...
...
Please
register
or
login
to post a comment