Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢林臻
sun
Commits
96aa2085
Commit
96aa2085
authored
Nov 15, 2019
by
zhongshangwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
化妆品列表搜索优化
parent
9fcf1158
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
product.py
api/product.py
+4
-3
No files found.
api/product.py
View file @
96aa2085
...
...
@@ -71,13 +71,14 @@ class ProductListView(APIView):
comment_nums_high
=
request
.
GET
.
get
(
'comment_nums_high'
,
None
)
effect_name
=
request
.
GET
.
get
(
'effect_name'
,
None
)
sorted_condition
=
request
.
GET
.
get
(
'sorted_condition'
,
None
)
effect_id
=
request
.
get
.
get
(
'effect_id'
,
None
)
data
=
self
.
rpc
[
'neptune/commodity/product/list'
](
offset
=
offset
,
count
=
count
,
id_
=
id_
,
cn_name
=
cn_name
,
en_name
=
en_name
,
alias
=
alias
,
is_online
=
is_online
,
has_area
=
has_area
,
has_brand
=
has_brand
,
has_image
=
has_image
,
brand_id
=
brand_id
,
classify_id
=
classify_id
,
category_id
=
category_id
,
price_low
=
price_low
,
price_high
=
price_high
,
grade_low
=
grade_low
,
grade_high
=
grade_high
,
comment_nums_low
=
comment_nums_low
,
comment_nums_high
=
comment_nums_high
,
effect_name
=
effect_name
,
sorted_condition
=
sorted_condition
)
.
unwrap
()
sorted_condition
=
sorted_condition
,
effect_id
=
effect_id
,
is_fuzzy
=
True
)
.
unwrap
()
product_ids
=
[
obj
.
get
(
'id'
)
for
obj
in
data
]
brand_product_dict
=
self
.
get_brand_infos
(
product_ids
)
...
...
@@ -105,7 +106,7 @@ class ProductListView(APIView):
id_
=
id_
,
cn_name
=
cn_name
,
en_name
=
en_name
,
alias
=
alias
,
is_online
=
is_online
,
has_area
=
has_area
,
has_brand
=
has_brand
,
has_image
=
has_image
,
brand_id
=
brand_id
,
category_id
=
category_id
,
classify_id
=
classify_id
,
price_low
=
price_low
,
price_high
=
price_high
,
grade_low
=
grade_low
,
grade_high
=
grade_high
,
comment_nums_low
=
comment_nums_low
,
comment_nums_high
=
comment_nums_high
,
effect_name
=
effect_name
)
.
unwrap
()
comment_nums_high
=
comment_nums_high
,
effect_name
=
effect_name
,
effect_id
=
effect_id
,
is_fuzzy
=
True
)
.
unwrap
()
result
=
{
'list'
:
data
,
'total'
:
count
,
...
...
@@ -219,6 +220,6 @@ class ProductSearchView(APIView):
if
not
name
:
return
r'缺少参数'
data
=
self
.
rpc
[
'neptune/commodity/product/search'
](
name
=
name
)
.
unwrap
()
data
=
self
.
rpc
[
'neptune/commodity/product/search'
](
name
=
name
,
is_fuzzy
=
True
)
.
unwrap
()
return
data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment