丁云鹏 1 mēnesi atpakaļ
vecāks
revīzija
3641c974b8
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      workers/video_insight_consumption_work.py

+ 5 - 1
workers/video_insight_consumption_work.py

@@ -97,10 +97,14 @@ class ConsumptionRecommend(object):
             video_id, video_link, video_title, demand_score,reason
             video_id, video_link, video_title, demand_score,reason
         ) VALUES
         ) VALUES
         """
         """
+        # Add values for each entry
+        values = []
         link = f"""https://admin.piaoquantv.com/cms/post-detail/{video_id}/detail"""
         link = f"""https://admin.piaoquantv.com/cms/post-detail/{video_id}/detail"""
+        entry = data
         value = f"""(
         value = f"""(
-            {video_id}, '{link}', '{video_title}', {data.get('需求强烈程度分值', '')}, '{data.get('理由', '')}'
+            {video_id}, '{link}', '{video_title}', {entry.get('需求强烈程度分值', '')}, '{entry.get('理由', '')}'
         )"""
         )"""
+        values.append(value)
         # Combine SQL statement and values
         # Combine SQL statement and values
         sql += ",\n".join(values) + ";"
         sql += ",\n".join(values) + ";"
         # Print SQL statement
         # Print SQL statement