简化商品插入数据表
This commit is contained in:
@@ -358,40 +358,6 @@ class GoodsModel:
|
||||
"""
|
||||
shopyy_data = excels.read_excel_to_dict(excel_path)
|
||||
for url, goods_info in shopyy_data.items():
|
||||
# main_info = {
|
||||
# 'spu': main_goods_info.spu,
|
||||
# 'title': main_goods_info.title,
|
||||
# 'brand': main_goods_info.category_name,
|
||||
# 'attr': main_goods_info.attribute,
|
||||
# 'desc': main_goods_info.desc,
|
||||
# 'price': main_goods_info.price,
|
||||
# 'old_price': main_goods_info.old_price,
|
||||
# 'images': orjson.dumps(main_goods_info.images),
|
||||
# 'url': main_goods_info.url,
|
||||
# 'other_data': orjson.dumps({})
|
||||
# }
|
||||
# for index, item_name in enumerate(main_goods_info.attribute_items):
|
||||
# if item_name:
|
||||
# main_info[f"item{index+1}"] = item_name
|
||||
|
||||
# son_infos = []
|
||||
# for p_info in main_goods_info.p_lists:
|
||||
# item = {
|
||||
# 'spu': p_info.spu,
|
||||
# 'price': p_info.price,
|
||||
# 'old_price': p_info.old_price,
|
||||
# 'images': orjson.dumps(p_info.images),
|
||||
# 'url': p_info.url,
|
||||
# 'other_data': orjson.dumps({}),
|
||||
# 'item1': None,
|
||||
# 'item2': None,
|
||||
# 'item3': None
|
||||
# }
|
||||
# for index, item_name in enumerate(p_info.attribute_items):
|
||||
# if item_name:
|
||||
# item[f"item{index+1}"] = item_name
|
||||
# son_infos.append(item)
|
||||
|
||||
self.add_goods(goods_info)
|
||||
|
||||
def splice_db(self, db_folder: str):
|
||||
|
||||
Reference in New Issue
Block a user