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
fc57d6e6
Commit
fc57d6e6
authored
Nov 19, 2019
by
钟尚武
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' into 'master'
化妆品列表搜索优化 See merge request
alpha/sun!400
parents
9fcf1158
bbbadcc2
Hide 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 @
fc57d6e6
...
@@ -71,13 +71,14 @@ class ProductListView(APIView):
...
@@ -71,13 +71,14 @@ class ProductListView(APIView):
comment_nums_high
=
request
.
GET
.
get
(
'comment_nums_high'
,
None
)
comment_nums_high
=
request
.
GET
.
get
(
'comment_nums_high'
,
None
)
effect_name
=
request
.
GET
.
get
(
'effect_name'
,
None
)
effect_name
=
request
.
GET
.
get
(
'effect_name'
,
None
)
sorted_condition
=
request
.
GET
.
get
(
'sorted_condition'
,
None
)
sorted_condition
=
request
.
GET
.
get
(
'sorted_condition'
,
None
)
effect_id
=
request
.
GET
.
get
(
'effect_id'
,
None
)
data
=
self
.
rpc
[
'neptune/commodity/product/list'
](
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
,
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
,
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
,
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
,
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
]
product_ids
=
[
obj
.
get
(
'id'
)
for
obj
in
data
]
brand_product_dict
=
self
.
get_brand_infos
(
product_ids
)
brand_product_dict
=
self
.
get_brand_infos
(
product_ids
)
...
@@ -105,7 +106,7 @@ class ProductListView(APIView):
...
@@ -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
,
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
,
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
,
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
=
{
result
=
{
'list'
:
data
,
'list'
:
data
,
'total'
:
count
,
'total'
:
count
,
...
@@ -219,6 +220,6 @@ class ProductSearchView(APIView):
...
@@ -219,6 +220,6 @@ class ProductSearchView(APIView):
if
not
name
:
if
not
name
:
return
r'缺少参数'
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
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