Skip to content

Commit

Permalink
砍价、秒杀时均不返回所有产品;搜索参数nameLike兼容为k的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
JoneXiong committed Dec 1, 2022
1 parent 9fbc048 commit 8f09b99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _product_category_dict(self, category_id):
return _dict

def get_goods_domain(self, category_id, nameLike, **kwargs):
if 'recommendStatus' in kwargs or 'pingtuan' in kwargs:
if 'recommendStatus' in kwargs or 'pingtuan' in kwargs or 'kanjia' in kwargs or 'miaosha' in kwargs:
return [('id', '=', 0)]
domain = [('sale_ok', '=', True), ('wxapp_published', '=', True)]
if not category_id and nameLike and nameLike.startswith('_c_'):
Expand Down Expand Up @@ -105,6 +105,8 @@ def list(self, sub_domain, categoryId=False, nameLike=False, page=1, pageSize=20
category_id = categoryId
token = kwargs.get('token', None)
order_by = kwargs.get('orderBy', None)
if not nameLike:
nameLike = kwargs.get('k')
try:
ret, entry = self._check_domain(sub_domain)
if ret:return ret
Expand Down

0 comments on commit 8f09b99

Please sign in to comment.