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
Plain Diff
Browse Files
Authored by
陈峰
7 years ago
Commit
edb8a0c51c96a9e6922603cfac2f2befef8bbd6d
2 parents
2b432156
5406ab30
Merge branch 'hotfix/list' into 'gray'
Hotfix/list See merge request
!190
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
apps/3party/controllers/sitemap.js
apps/product/models/list-handler.js
apps/3party/controllers/sitemap.js
View file @
edb8a0c
...
...
@@ -135,7 +135,7 @@ const siteMap = (req, res, next) => {
let
siteList
=
[
'www'
,
'list'
,
'item'
],
subdomain
=
req
.
subdomains
[
0
]
||
'www'
;
if
(
_
.
find
(
siteList
,
subdomain
)
)
{
if
(
_
.
indexOf
(
siteList
,
subdomain
)
===
-
1
)
{
res
.
end
(
'end'
);
return
;
}
...
...
apps/product/models/list-handler.js
View file @
edb8a0c
...
...
@@ -237,7 +237,7 @@ class FilterTools {
condition
.
name
=
sizeFind
.
size_name
;
}
}
else
if
(
k
===
'age_level'
)
{
if
(
filter
.
ageLevel
.
length
>
1
)
{
if
(
filter
.
ageLevel
)
{
const
ageFind
=
_
.
find
(
filter
.
ageLevel
,
c
=>
+
c
.
id
===
_
.
parseInt
(
params
.
age_level
));
if
(
ageFind
)
{
...
...
@@ -449,18 +449,33 @@ class FilterTools {
let
{
baseUrl
,
origin
,
params
}
=
this
;
const
standards
=
_
.
get
(
origin
,
'standard'
,
{});
const
filterStandars
=
[];
const
standarParam
=
params
.
standard
||
''
;
const
href
=
handleFilterUrl
(
baseUrl
,
params
,
{
standard
:
'${standard}'
});
let
standarParam
=
{};
_
.
each
(
_
.
split
(
params
.
standard
||
''
,
','
),
item
=>
{
const
sps
=
_
.
split
(
item
,
'_'
);
if
(
sps
.
length
===
2
)
{
standarParam
[
sps
[
0
]]
=
sps
[
1
];
}
});
_
.
each
(
standards
,
standard
=>
{
if
(
standard
.
sub
.
length
>
1
)
{
filterStandars
.
push
({
name
:
standard
.
standard_name
,
sub
:
_
.
map
(
standard
.
sub
,
sub
=>
{
const
standarParamItem
=
Object
.
assign
({},
standarParam
,
{
[
standard
.
standard_id
]:
sub
.
standard_id
});
const
standarParamStr
=
_
.
join
(
_
.
map
(
standarParamItem
,
(
v
,
k
)
=>
{
return
`
$
{
k
}
_$
{
v
}
`
;
}),
','
);
return
{
name
:
sub
.
standard_name
,
href
:
href
.
replace
(
'${standard}'
,
`
$
{
standarParam
}
$
{
standarParam
&&
','
}
$
{
standard
.
standard_id
}
_$
{
sub
.
standard_id
}
`
),
href
:
href
.
replace
(
'${standard}'
,
standarParamStr
),
checked
:
_
.
parseInt
(
sub
.
standard_id
)
===
_
.
parseInt
(
standarParam
[
standard
.
standard_id
]),
id
:
sub
.
standard_id
};
})
...
...
Please
register
or
login
to post a comment