|
@@ -198,6 +198,24 @@ function searchZhanghuName(name,id)
|
|
|
M.setZhanghuOfMain({id_list=id_list,main_id=id})
|
|
|
end
|
|
|
end
|
|
|
+
|
|
|
+function M.advertiserListOfMain(msg_body)
|
|
|
+ local isok ,key = tools.checkData({"id_list","main_id"},msg_body)
|
|
|
+ if not isok then
|
|
|
+ return false,string.format("缺少字段: %s.", key)
|
|
|
+ end
|
|
|
+ local fail_list = {}
|
|
|
+ for i = 1, #msg_body.id_list, 1 do
|
|
|
+ local id = msg_body.id_list[i]
|
|
|
+ local sql = string.format("SELECT * FROM advertiser where advertiser_id = '%s' and main_id = %d ", id,msg_body.main_id)
|
|
|
+ local isok,res;
|
|
|
+ res = mysqldbx.query(sql)
|
|
|
+ if #res <1 then
|
|
|
+ table.insert(fail_list,#fail_list+1,id)
|
|
|
+ end
|
|
|
+ end
|
|
|
+ return true,fail_list
|
|
|
+end
|
|
|
function M.init()
|
|
|
local sql = string.format("select * from `tg_main` ")
|
|
|
local isok,res;
|