Commit fc57d6e6 authored by 钟尚武's avatar 钟尚武

Merge branch 'product' into 'master'

化妆品列表搜索优化

See merge request alpha/sun!400
parents 9fcf1158 bbbadcc2
...@@ -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
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