904118851 2 hónapja
szülő
commit
263dd3d382
1 módosított fájl, 18 hozzáadás és 0 törlés
  1. 18 0
      common/dbproxy/tg_zhanghu.lua

+ 18 - 0
common/dbproxy/tg_zhanghu.lua

@@ -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;