Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
tychxn committed Jan 27, 2020
1 parent d12b725 commit 1bee4a4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions jd_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,14 @@ def if_item_can_be_ordered(self, sku_ids, area):
# 查询商品库存
stock = self.get_multi_item_stock(sku_ids=sku_ids, area=area) if len(sku_ids) > 1 \
else self.get_single_item_stock(sku_id=sku_ids[0], area=area)

# 查询商品是否下架
if not stock:
return False
else:
for sku_id in sku_ids:
if self._if_item_removed(sku_id=sku_id):
return False

# 查询商品是否下架
for sku_id in sku_ids:
if self._if_item_removed(sku_id=sku_id):
return False

return True

def get_item_price(self, sku_id):
Expand Down

0 comments on commit 1bee4a4

Please sign in to comment.