Commit acde9d13 by 岳巧源

skip unit update

parent defc420a
Showing with 12 additions and 3 deletions
......@@ -7,9 +7,7 @@ import time
import sys
import json
"""
关键问题记录,有课呢个
"""
config_dev = {
"mysql": {
......@@ -193,6 +191,8 @@ def update_pop_attr(conf: dict):
"""
exists_attr = True
for key in origin_attr_map:
if key == "unit":
continue
if origin_attr_map[key] != now_attr_map[key]:
update_sql1 = "update lie_shop_attr set attr_id = %s, attr_name = %s, unit = %s, enum_value = %s, input_type = %s, is_required = %s, update_time = %s , is_mapping = 0 where id = %s"
cursor.execute(query=update_sql1, args=(attr_id, attr_name, unit, enum_value, input_type, is_required, update_time, primary_id))
......@@ -248,7 +248,16 @@ def handle_vc_unit(conf: dict):
"""
input_type 为10的单位单独处理。
"""
if str(unit) == "" or str(unit) == "[]":
continue
end = str(unit).find(",")
"""
处理特殊情况,unit字段可能为 ["V"] 或者 [] 或者空字符串
"""
if end == -1:
end = str(unit).find("]")
if end == -1:
continue
default_unit = unit[2:end-1]
update_sql = "update lie_shop_attr set default_unit = %s where id = %s"
cursor.execute(query=update_sql, args=(default_unit, id,))
......
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