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