|
@@ -6,22 +6,22 @@ local skynet = require "skynet"
|
|
|
|
|
|
|
|
|
function M.add_platform(msg_body)
|
|
|
- local isok ,key = tools.checkData({"tg_platform_name","tg_platform_id"},msg_body)
|
|
|
+ local isok ,key = tools.checkData({"zd_boost_number","tg_platform_name","tg_platform_id"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
|
end
|
|
|
- local sql = string.format("INSERT INTO `statistics_platform` (tg_platform_name,tg_platform_id) VALUES ('%s',%d)",msg_body.tg_platform_name,msg_body.tg_platform_id)
|
|
|
+ local sql = string.format("INSERT INTO `statistics_platform` (zd_boost_number,tg_platform_name,tg_platform_id) VALUES (%d,'%s',%d)",msg_body.zd_boost_number,msg_body.tg_platform_name,msg_body.tg_platform_id)
|
|
|
mysqldbx.query(sql)
|
|
|
return true, {}
|
|
|
end
|
|
|
|
|
|
|
|
|
function M.modify(msg_body)
|
|
|
- local isok ,key = tools.checkData({"tg_platform_name","id","tg_platform_id"},msg_body)
|
|
|
+ local isok ,key = tools.checkData({"zd_boost_number","tg_platform_name","id","tg_platform_id"},msg_body)
|
|
|
if not isok then
|
|
|
return false,string.format("缺少字段: %s.", key)
|
|
|
end
|
|
|
- local sql = string.format("UPDATE statistics_platform SET tg_platform_name = '%s' , tg_platform_id = %d WHERE id = %d ",msg_body.tg_platform_name, msg_body.tg_platform_id,msg_body.id)
|
|
|
+ local sql = string.format("UPDATE statistics_platform SET zd_boost_number = %d , tg_platform_name = '%s' , tg_platform_id = %d WHERE id = %d ", msg_body.zd_boost_number,msg_body.tg_platform_name, msg_body.tg_platform_id,msg_body.id)
|
|
|
mysqldbx.query(sql)
|
|
|
return true, {}
|
|
|
end
|