Commit 09fb4a83 by 岳巧源

modify ext flag

parent 34ee5cf0
Showing with 11 additions and 11 deletions
......@@ -110,7 +110,7 @@ def update_vc_attr(conf: dict):
"""
先预先把此分类的全部属性查询出来
"""
check_sql = "select id, class_id, attr_id, attr_name, unit, enum_value, input_type, is_required from lie_shop_attr where platform = 1 and class_id = %s"
check_sql = "select id, class_id, attr_id, attr_name, unit, enum_value, input_type, is_required from lie_shop_attr where platform = 1 and is_ext = 1 and class_id = %s"
cursor.execute(query=check_sql, args=(class_id, ))
check_result = cursor.fetchall()
for j in range(len(jd_results)):
......@@ -216,10 +216,10 @@ def update_vc_attr(conf: dict):
else:
continue
if not exists_attr:
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,))
insert_sql = "insert into lie_shop_attr (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time, is_ext) values (%s, %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, 1))
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, 1))
def handle_vc_unit(conf: dict):
......@@ -290,7 +290,7 @@ def update_vc_ext_attr(conf):
"""
预先把分类id对应的属性先查询出来。
"""
check_sql = "select id, class_id, attr_id, attr_name, unit, enum_value, input_type, is_required from lie_shop_attr where platform = 1 and class_id = %s"
check_sql = "select id, class_id, attr_id, attr_name, unit, enum_value, input_type, is_required from lie_shop_attr where platform = 1 and is_ext = 2 and class_id = %s"
cursor.execute(query=check_sql, args=(class_id, ))
check_result = cursor.fetchall()
for j in range(len(jd_results)):
......@@ -378,10 +378,10 @@ def update_vc_ext_attr(conf):
else:
continue
if not exists_attr:
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,))
insert_sql = "insert into lie_shop_attr (class_id, attr_id, attr_name, unit, enum_value, input_type, is_required, status, platform, create_time, is_ext) values (%s, %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, 2))
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, 2))
......
......@@ -434,5 +434,5 @@ def modify_vc_purchase_price():
print(json.dumps(ans, ensure_ascii=False))
if __name__ == '__main__':
# modify_jd_vc_market_price()
modify_vc_purchase_price()
\ No newline at end of file
modify_jd_vc_market_price()
# modify_vc_purchase_price()
\ No newline at end of file
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