904118851 před 8 měsíci
rodič
revize
7f2e3de708
2 změnil soubory, kde provedl 7 přidání a 5 odebrání
  1. 3 1
      common/dbproxy/tg_main.lua
  2. 4 4
      service/backmgr/filter_task.lua

+ 3 - 1
common/dbproxy/tg_main.lua

@@ -107,10 +107,12 @@ function pushAddMainMsg(msg_body)
             -- end
             --根据小程序id 筛选出所有需要创建的书籍
             local video_applet_product_of_main_list = {}
+            local verify_list = {}
             for i = 1, #video_applet_product_list, 1 do
                 local applet_item = video_applet_product_list[i]
-                if video_applet_product_of_main_list[applet_item.product_id]==nil then
+                if verify_list[applet_item.product_id]==nil then
                     if applet_item.status == 1 and applet_item.dy_small_applet_app_id == main_info.app_id then
+                        verify_list[applet_item.product_id] = true
                         table.insert(video_applet_product_of_main_list,#video_applet_product_of_main_list+1,{product_name=applet_item.product_name,product_id=applet_item.product_id,book_platform=applet_item.book_platform,dy_small_applet_app_id=applet_item.dy_small_applet_app_id})
                     end
                 end

+ 4 - 4
service/backmgr/filter_task.lua

@@ -556,12 +556,12 @@ function M.send_book_data(msg_body)
     for i = 1, #res, 1 do
         local product_id =   res[i].product_id
         local product_name = res[i].product_name
-        local sql = string.format("SELECT * FROM video_applet_product where product_id = '%s' and book_platform  = %d and dy_small_applet_app_id = '%s' ",product_id,msg_body.tg_platform_id,msg_body.app_id)
-        res = mysqldtaskbx.Singleton().query(sql)
-        if #res<=0 then 
+        local sql = string.format("SELECT * FROM video_applet_product where product_id = '%s' and book_platform  = %d and dy_small_applet_app_id = '%s' and main_id = %d ",product_id,msg_body.tg_platform_id,msg_body.app_id,msg_body.main_id)
+        local result = mysqldtaskbx.Singleton().query(sql)
+        if #result<=0 then 
             sql = string.format("INSERT INTO `video_applet_product` (product_id,product_name,book_platform,dy_small_applet_app_id,main_id,wait_status,status)  VALUES ('%s','%s',%d,'%s',%d,%d,%d)",
             product_id,product_name,msg_body.tg_platform_id,msg_body.app_id,msg_body.main_id,0,0)
-            res = mysqldtaskbx.Singleton().query(sql)
+            mysqldtaskbx.Singleton().query(sql)
         end
     end
     return true,{}