查询用户接口返回json数据
This commit is contained in:
parent
756f9b7343
commit
f3c602f90e
|
|
@ -64,12 +64,12 @@ function _M.getUser(id)
|
||||||
ngx.exit(ngx.HTTP_NOT_FOUND)
|
ngx.exit(ngx.HTTP_NOT_FOUND)
|
||||||
end
|
end
|
||||||
--整理数据库结果返回值
|
--整理数据库结果返回值
|
||||||
for _, row in ipairs(res) do
|
--for _, row in ipairs(res) do
|
||||||
for key, value in pairs(row) do
|
-- for key, value in pairs(row) do
|
||||||
ngx.say(key .. ":" .. tostring(value))
|
-- ngx.say(key .. ":" .. tostring(value))
|
||||||
end
|
-- end
|
||||||
end
|
--end
|
||||||
|
ngx.say(cjson.encode(res))
|
||||||
--关闭数据库
|
--关闭数据库
|
||||||
conn:disconnect()
|
conn:disconnect()
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user