Commit ff83e25d by larosa

add update

parent 489de7fb
Showing with 11 additions and 11 deletions
...@@ -217,17 +217,17 @@ def update_ext_attr_by_class_ids(conf: dict): ...@@ -217,17 +217,17 @@ def update_ext_attr_by_class_ids(conf: dict):
print("暂时未兼容此种类型的拓展属性 input_type: " + str(input_type)) print("暂时未兼容此种类型的拓展属性 input_type: " + str(input_type))
# 检查此分类的此拓展属性在 db 中是否已存在,未存在则 insert, 存在则 update # 检查此分类的此拓展属性在 db 中是否已存在,未存在则 insert, 存在则 update
# check_sql = "select id from lie_shop_attr where class_id = %s and attr_id = %s" check_sql = "select id from lie_shop_attr where class_id = %s and attr_id = %s"
# cursor.execute(query=check_sql, args=(class_id, attr_id,)) cursor.execute(query=check_sql, args=(class_id, attr_id,))
# db_result = cursor.fetchall() db_result = cursor.fetchall()
# if len(db_result) == 0: if len(db_result) == 0:
# # 不存在时 # 不存在时
# insert_sql = "insert into lie_shop_attr (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time) values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" insert_sql = "insert into lie_shop_attr (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time) values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"
# cursor.execute(query=insert_sql, args=(class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time,)) cursor.execute(query=insert_sql, args=(class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time,))
# db.commit() db.commit()
# print(insert_sql % (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time)) print(insert_sql % (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time))
# else: else:
# update_sql = "" update_sql = ""
insert_ext_attr_to_redis(class_attr_mapping, conf) insert_ext_attr_to_redis(class_attr_mapping, conf)
......
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 sign in to comment