--推广 local M = {} local mysqldbx = require "mysqldbx" local tools = require "tools" local skynet = require "skynet" local cjson = require "cjson" local config = require "run_config" local db --设置推广状态 function M.set_tui_guang_status(msg_body) local isok ,key = tools.checkData({"id_list","status"},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("SELECT * FROM video_material WHERE id IN (%s)",idString) local isok,res; res = mysqldbx.query(sql) for i = 1, #res, 1 do local id = res[i].id local material_id = res[i].material_id sql = string.format("UPDATE video_material SET status = %d WHERE id =%d ",msg_body.status,id) mysqldbx.query(sql) end return true,{} end return M