|
@@ -266,6 +266,15 @@ class YsbSpider:
|
|
|
shop_name = item.get("abbreviation", "")
|
|
shop_name = item.get("abbreviation", "")
|
|
|
|
|
|
|
|
brand = item.get("brand","")
|
|
brand = item.get("brand","")
|
|
|
|
|
+
|
|
|
|
|
+ # 销量: 优先 order_amount > orderAmountPlus > alreadysales
|
|
|
|
|
+ sales = (
|
|
|
|
|
+ item.get("order_amount")
|
|
|
|
|
+ or item.get("orderAmountPlus")
|
|
|
|
|
+ or item.get("alreadysales")
|
|
|
|
|
+ or ""
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
product = {
|
|
product = {
|
|
|
"platform": self.platform,
|
|
"platform": self.platform,
|
|
|
"item_id": item_id,
|
|
"item_id": item_id,
|
|
@@ -285,7 +294,7 @@ class YsbSpider:
|
|
|
"factory_name": item.get("manufacturer", ""),
|
|
"factory_name": item.get("manufacturer", ""),
|
|
|
"scrape_date": time.strftime("%Y-%m-%d"),
|
|
"scrape_date": time.strftime("%Y-%m-%d"),
|
|
|
"price": price,
|
|
"price": price,
|
|
|
- "sales": "",
|
|
|
|
|
|
|
+ "sales": sales,
|
|
|
"stock_count": item.get("stockAvailable", ""),
|
|
"stock_count": item.get("stockAvailable", ""),
|
|
|
"snapshot_url": "",
|
|
"snapshot_url": "",
|
|
|
"approval_num": self.approval_num,
|
|
"approval_num": self.approval_num,
|