904118851 5 月之前
父节点
当前提交
f7cb2a83ea
共有 2 个文件被更改,包括 19 次插入1 次删除
  1. 5 1
      common/dbproxy/tg_main.lua
  2. 14 0
      service/backmgr/filter_data.lua

+ 5 - 1
common/dbproxy/tg_main.lua

@@ -76,6 +76,10 @@ function M.search(msg_body)
 
     local offset = (page_number - 1) * page_size
 
+    local infra_status_param = ""
+    if msg_body.infra_status~=""  then
+        infra_status_param = string.format(" AND infra_status =  %d ",msg_body.infra_status) 
+    end
 
     local cbo_script_status_param = ""
     if msg_body.cbo_script_status~=""  then
@@ -178,7 +182,7 @@ function M.search(msg_body)
         genre_param =  string.format(" AND genre = %d ",msg_body.genre) 
     end
 
-    local param = cbo_script_status_param..cbo_status_param..project_type_param..oce_product_platform_id_param..oce_product_id_param..delivery_mode_param..main_name_param..tg_platform_param..running_status_param..pay_type_param..butler_id_param..tg_app_index_param..is_open_create_link_param..is_delete_param..custom_budget_param..cpa_bid_param..template_bid_param..genre_param..wx_miniapp_create_status_param..material_platform_id_param;
+    local param = infra_status_param..cbo_script_status_param..cbo_status_param..project_type_param..oce_product_platform_id_param..oce_product_id_param..delivery_mode_param..main_name_param..tg_platform_param..running_status_param..pay_type_param..butler_id_param..tg_app_index_param..is_open_create_link_param..is_delete_param..custom_budget_param..cpa_bid_param..template_bid_param..genre_param..wx_miniapp_create_status_param..material_platform_id_param;
 
     local sql = "SELECT * FROM tg_main where 1=1 "..param..string.format(" LIMIT %d OFFSET %d ",page_size, offset)
     local res = mysqldbx.query(sql)

+ 14 - 0
service/backmgr/filter_data.lua

@@ -125,4 +125,18 @@ function M.set_material_sync_status(msg_body)
     return true,{}
 end
 
+
+--设置任务权重
+function M.set_weight(msg_body)
+    local isok ,key =  tools.checkData({"id_list","weight"},msg_body)
+    if not isok then
+        return false,string.format("缺少字段: %s.", key)
+    end
+    local idString = table.concat(msg_body.id_list, ",")
+    local sql = string.format("UPDATE  filter_data SET weight = %d    WHERE id IN (%s) ",msg_body.weight,idString)
+    skynet.error("sql:",sql)
+    mysqldbx.query(sql)
+    return true,{}
+end
+
 return M