|
@@ -18,13 +18,13 @@ end
|
|
|
|
|
|
--添加平台
|
|
|
function M.addPlatform(msg_body)
|
|
|
- local isok ,key ,id= tools.checkData({"tg_platform_name","filter_guajian_logic"},msg_body)
|
|
|
+ local isok ,key ,id= tools.checkData({"platform_shared_id","mini_program_platform_id","tg_platform_name","filter_guajian_logic"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
|
end
|
|
|
local _,data = M.getTotal()
|
|
|
local id = data.total + 1
|
|
|
- local sql = string.format("INSERT INTO `tg_platform` (tg_platform_id,tg_platform_name,filter_guajian_logic) VALUES (%d,'%s','%s')",id,msg_body.tg_platform_name,msg_body.filter_guajian_logic)
|
|
|
+ local sql = string.format("INSERT INTO `tg_platform` (platform_shared_id,mini_program_platform_id,tg_platform_id,tg_platform_name,filter_guajian_logic) VALUES (%d,%d,%d,'%s','%s')",msg_body.platform_shared_id,msg_body.mini_program_platform_id,id,msg_body.tg_platform_name,msg_body.filter_guajian_logic)
|
|
|
skynet.error(sql)
|
|
|
mysqldbx.query(sql)
|
|
|
skynet.send("backmgr","lua","on_recv",nil,"ws_push_msg",cjson.encode({cmd="updatePlatformConfig"}))
|
|
@@ -34,11 +34,13 @@ end
|
|
|
|
|
|
--修改平台
|
|
|
function M.modifyPlatform(msg_body)
|
|
|
- local isok ,key = tools.checkData({"tg_platform_name","id","filter_guajian_logic"},msg_body)
|
|
|
+ local isok ,key = tools.checkData({"platform_shared_id","mini_program_platform_id","tg_platform_name","id","filter_guajian_logic"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
|
end
|
|
|
- local sql = string.format("UPDATE `tg_platform` SET filter_guajian_logic = '%s' , tg_platform_name = '%s' WHERE id = %d ",
|
|
|
+ local sql = string.format("UPDATE `tg_platform` SET platform_shared_id = %d , mini_program_platform_id = %d , filter_guajian_logic = '%s' , tg_platform_name = '%s' WHERE id = %d ",
|
|
|
+ msg_body.platform_shared_id,
|
|
|
+ msg_body.mini_program_platform_id,
|
|
|
msg_body.filter_guajian_logic,
|
|
|
msg_body.tg_platform_name,msg_body.id)
|
|
|
mysqldbx.query(sql)
|