904118851 8 місяців тому
батько
коміт
bd7707dbae

+ 19 - 19
common/dbproxy/tg_main.lua

@@ -69,28 +69,28 @@ function M.syncMain(msg_body)
 end
 
 function syncMainAppletProduct(main_info)
-    local tg_platform_id = main_info.tg_platform_id
-    local app_id = main_info.app_id
-    local sql = string.format("SELECT * FROM video_product where book_platform = %d ",tg_platform_id)
-    local video_product_list = mysqldtaskbx.Singleton().query(sql)
+    -- local tg_platform_id = main_info.tg_platform_id
+    -- local app_id = main_info.app_id
+    -- local sql = string.format("SELECT * FROM video_product where book_platform = %d ",tg_platform_id)
+    -- local video_product_list = mysqldtaskbx.Singleton().query(sql)
 
 
-    function isHaveAppletProdut(product_id)
-        local s = string.format("SELECT * FROM video_applet_product where dy_small_applet_app_id = '%s' and product_id = '%s' and main_id = %d and book_platform = %d LIMIT 1",app_id,product_id,main_info.id,tg_platform_id)
-        local r = mysqldtaskbx.Singleton().query(sql)
-        return #r>0
-    end
+    -- function isHaveAppletProdut(product_id)
+    --     local s = string.format("SELECT * FROM video_applet_product where dy_small_applet_app_id = '%s' and product_id = '%s' and main_id = %d and book_platform = %d LIMIT 1",app_id,product_id,main_info.id,tg_platform_id)
+    --     local r = mysqldtaskbx.Singleton().query(sql)
+    --     return #r>0
+    -- end
 
-    local need_create_link_list = {}
-    local verify_list = {}
-    for i = 1, #video_product_list, 1 do
-        local product = video_product_list[i]
-        if not isHaveAppletProdut(product.product_id) and not verify_list[product.product_id] then
-            verify_list[product.product_id] = true
-            table.insert(need_create_link_list,#need_create_link_list+1,{product_name=product.product_name,product_id=product.product_id,book_platform=product.book_platform})
-        end
-    end
-    skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="syncMain",data={list=need_create_link_list,main_info=main_info}}))
+    -- local need_create_link_list = {}
+    -- local verify_list = {}
+    -- for i = 1, #video_product_list, 1 do
+    --     local product = video_product_list[i]
+    --     if not isHaveAppletProdut(product.product_id) and not verify_list[product.product_id] then
+    --         verify_list[product.product_id] = true
+    --         table.insert(need_create_link_list,#need_create_link_list+1,{product_name=product.product_name,product_id=product.product_id,book_platform=product.book_platform})
+    --     end
+    -- end
+    skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="syncMain",data={ain_info=main_info}}))
 end
 
 function pushAddMainMsg(msg_body)

+ 11 - 1
service/backmgr/promotion_audit_suggestions.lua

@@ -61,12 +61,22 @@ function M.search_promotion_audit_suggestions(msg_body)
         status_param = " AND status = "..msg_body.status
     end
 
+    local product_id_param = ""
+    if msg_body.product_id~="" then
+        product_id_param = " AND product_id = "..msg_body.product_id
+    end
+
+    local product_library_id_param = ""
+    if msg_body.product_library_id~="" then
+        product_library_id_param = " AND product_library_id = "..msg_body.product_library_id
+    end
+
     local create_date_param = ""
     if msg_body.start_create_time~="" and msg_body.end_create_time~="" then
         create_date_param = " AND DATE(created_at) >= DATE(FROM_UNIXTIME(" .. (msg_body.start_create_time / 1000) .. ")) AND DATE(created_at) <= DATE(FROM_UNIXTIME(" .. (msg_body.end_create_time / 1000) .. "))"
     end
 
-    local param = create_date_param..advertiser_id_param..promotion_id_param..material_type_param..material_item_param..status_param
+    local param = create_date_param..advertiser_id_param..promotion_id_param..material_type_param..material_item_param..status_param..product_id_param..product_library_id_param
 
     local sql = "SELECT * FROM promotion_audit_suggestions WHERE 1=1 "..param..string.format(" LIMIT %d OFFSET %d ",page_size, offset)
    

+ 12 - 0
service/backmgr/task_material_queue_queue.lua

@@ -90,4 +90,16 @@ function M.search_task_material_queue_queue(msg_body)
     return true,list,total[1].total
 end
 
+function M.delete_task_material_queue_queue(msg_body)
+    local isok ,key =  tools.checkData({"id_list"},msg_body)
+    if not isok then
+        return false,string.format("缺少字段: %s.", key)
+    end
+    for i = 1, #msg_body.id_list, 1 do
+        local id = msg_body.id_list[i]
+        local sql = string.format("DELETE FROM task_material_queue_queue WHERE id = %d ",id)
+        mysqldbx.query(sql)
+    end
+    return true, {}
+end
 return M