Commit 221d6723 by 岳巧源

add vc class

parent ad06ab27
Showing with 6 additions and 2 deletions
...@@ -76,6 +76,12 @@ def insert_vc_class(conf: dict): ...@@ -76,6 +76,12 @@ def insert_vc_class(conf: dict):
status = 1 status = 1
platform = 1 platform = 1
create_time = int(time.time()) create_time = int(time.time())
# check if already exist.
check_sql = "select class_id from lie_shop_class where class_id = %s"
cursor.execute(query=check_sql, args=(class_id,))
check_result = cursor.fetchall()
if len(check_result) > 0:
continue
insert_sql = "insert into lie_shop_class (parent_id, class_id, class_name, depth, status, platform, create_time) values (%s, %s, %s, %s, %s, %s, %s)" insert_sql = "insert into lie_shop_class (parent_id, class_id, class_name, depth, status, platform, create_time) values (%s, %s, %s, %s, %s, %s, %s)"
cursor.execute(query=insert_sql, args=(parent_id, class_id, class_name, depth, status, platform, create_time,)) cursor.execute(query=insert_sql, args=(parent_id, class_id, class_name, depth, status, platform, create_time,))
db.commit() db.commit()
...@@ -372,4 +378,3 @@ def get_vc_goods_info(ware_id: str): ...@@ -372,4 +378,3 @@ def get_vc_goods_info(ware_id: str):
if __name__ == '__main__': if __name__ == '__main__':
get_vc_goods_info("100124079761")
\ 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