Browse Source

抖音搜索词录入

jihuaqiang 8 hours ago
parent
commit
f45dad4b93
1 changed files with 7 additions and 4 deletions
  1. 7 4
      query_key/aggregate_queries.py

+ 7 - 4
query_key/aggregate_queries.py

@@ -64,11 +64,11 @@ def save_to_database(combinations):
         # clear_sql = "DELETE FROM knowledge_content_query"
         # MysqlHelper.update_values(clear_sql)
         
-        # 插入数据的SQL语句
+        # 插入数据的SQL语句,允许重复记录
         insert_sql = """
         INSERT INTO knowledge_content_query 
-        (stage, content_type, content_format, query_word, status, create_time) 
-        VALUES (%s, %s, %s, %s, %s, %s)
+        (stage, content_type, content_format, query_word, status, channel, create_time) 
+        VALUES (%s, %s, %s, %s, %s, %s, %s)
         """
         
         success_count = 0
@@ -82,9 +82,12 @@ def save_to_database(combinations):
                 combo["content_type"],
                 combo["content_format"],
                 combo["query_word"],
-                0,  # status设为0
+                1,  # 1: 未处理 0: 已处理
+                2,  # 1: 小红书 2: 抖音
                 combo["create_time"]
             )
+
+            print(params)
             
             result = MysqlHelper.update_values(insert_sql, params)
             if result is not None: