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
e823a6a7
Commit
e823a6a7
authored
Jul 16, 2019
by
haowang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix code product list
parent
606bcbb4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
product.py
api/product.py
+6
-5
No files found.
api/product.py
View file @
e823a6a7
...
@@ -61,6 +61,7 @@ class ProductListView(APIView):
...
@@ -61,6 +61,7 @@ class ProductListView(APIView):
has_brand
=
request
.
GET
.
get
(
'has_brand'
,
None
)
has_brand
=
request
.
GET
.
get
(
'has_brand'
,
None
)
has_image
=
request
.
GET
.
get
(
'has_image'
,
None
)
has_image
=
request
.
GET
.
get
(
'has_image'
,
None
)
brand_id
=
request
.
GET
.
get
(
'brand_id'
,
None
)
brand_id
=
request
.
GET
.
get
(
'brand_id'
,
None
)
classify_id
=
request
.
GET
.
get
(
'classify_id'
,
None
)
category_id
=
request
.
GET
.
get
(
'category_id'
,
None
)
category_id
=
request
.
GET
.
get
(
'category_id'
,
None
)
price_low
=
request
.
GET
.
get
(
'price_low'
,
None
)
price_low
=
request
.
GET
.
get
(
'price_low'
,
None
)
price_high
=
request
.
GET
.
get
(
'price_high'
,
None
)
price_high
=
request
.
GET
.
get
(
'price_high'
,
None
)
...
@@ -70,16 +71,16 @@ class ProductListView(APIView):
...
@@ -70,16 +71,16 @@ class ProductListView(APIView):
comment_nums_high
=
request
.
GET
.
get
(
'comment_nums_high'
,
None
)
comment_nums_high
=
request
.
GET
.
get
(
'comment_nums_high'
,
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
,
has_area
=
has_area
,
offset
=
offset
,
count
=
count
,
id_
=
id_
,
cn_name
=
cn_name
,
en_name
=
en_name
,
alias
=
alias
,
is_online
=
is_online
,
has_brand
=
has_brand
,
has_image
=
has_image
,
brand_id
=
brand_id
,
category_id
=
category_id
,
price_low
=
price_low
,
price_high
=
price_high
,
has_area
=
has_area
,
has_brand
=
has_brand
,
has_image
=
has_image
,
brand_id
=
brand_id
,
classify_id
=
classify_id
,
grade_low
=
grade_low
,
grade_high
=
grade_high
,
comment_nums_low
=
comment_nums_low
,
comment_nums_high
=
comment_nums_high
)
.
unwrap
()
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
)
.
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
)
category_product_dict
=
self
.
get_category_infos
(
product_ids
)
category_product_dict
=
self
.
get_category_infos
(
product_ids
)
effect_product_dict
=
self
.
get_effect_infos
(
product_ids
)
effect_product_dict
=
self
.
get_effect_infos
(
product_ids
)
classify_product_dict
=
self
.
get_classify_infos
(
product_ids
)
classify_product_dict
=
self
.
get_classify_infos
(
product_ids
)
print
(
category_product_dict
,
effect_product_dict
,
classify_product_dict
)
for
obj
in
data
:
for
obj
in
data
:
product_id
=
obj
.
get
(
'id'
)
product_id
=
obj
.
get
(
'id'
)
...
@@ -99,7 +100,7 @@ class ProductListView(APIView):
...
@@ -99,7 +100,7 @@ class ProductListView(APIView):
count
=
self
.
rpc
[
'neptune/commodity/product/count'
](
count
=
self
.
rpc
[
'neptune/commodity/product/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
,
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
,
price_low
=
price_low
,
price_high
=
price_high
,
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
)
.
unwrap
()
grade_low
=
grade_low
,
grade_high
=
grade_high
,
comment_nums_low
=
comment_nums_low
,
comment_nums_high
=
comment_nums_high
)
.
unwrap
()
result
=
{
result
=
{
'list'
:
data
,
'list'
:
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