Commit e823a6a7 authored by haowang's avatar haowang

fix code product list

parent 606bcbb4
......@@ -61,6 +61,7 @@ class ProductListView(APIView):
has_brand = request.GET.get('has_brand', None)
has_image = request.GET.get('has_image', 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)
price_low = request.GET.get('price_low', None)
price_high = request.GET.get('price_high', None)
......@@ -70,16 +71,16 @@ class ProductListView(APIView):
comment_nums_high = request.GET.get('comment_nums_high', 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, 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()
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).unwrap()
product_ids = [obj.get('id') for obj in data]
brand_product_dict = self.get_brand_infos(product_ids)
category_product_dict = self.get_category_infos(product_ids)
effect_product_dict = self.get_effect_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:
product_id = obj.get('id')
......@@ -99,7 +100,7 @@ class ProductListView(APIView):
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,
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()
result = {
'list': data,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment