修改使用的用户表
This commit is contained in:
parent
da2d95a9b4
commit
a3a7ee26ea
|
|
@ -74,7 +74,7 @@ end
|
||||||
local function checkUserExist(username, phone, email)
|
local function checkUserExist(username, phone, email)
|
||||||
--组装sql语句
|
--组装sql语句
|
||||||
local where = string.format("where username='%s' or phone='%s' or email='%s'", username, phone, email)
|
local where = string.format("where username='%s' or phone='%s' or email='%s'", username, phone, email)
|
||||||
local sql = string.format("select count(*) as count from \"T_Users\" %s", where)
|
local sql = string.format("select count(*) as count from \"tbl_users\" %s", where)
|
||||||
print("check sql: "..sql)
|
print("check sql: "..sql)
|
||||||
--获取数据库连接
|
--获取数据库连接
|
||||||
return execSQL(sql)
|
return execSQL(sql)
|
||||||
|
|
@ -83,14 +83,14 @@ end
|
||||||
-- 查询数据表中的所有用户信息
|
-- 查询数据表中的所有用户信息
|
||||||
function _M.getAllUser()
|
function _M.getAllUser()
|
||||||
--组装sql语句
|
--组装sql语句
|
||||||
local sql = "select * from \"T_Users\""
|
local sql = "select * from \"tbl_users\""
|
||||||
return execSQL(sql)
|
return execSQL(sql)
|
||||||
end
|
end
|
||||||
|
|
||||||
--根据用户id获取用户信息
|
--根据用户id获取用户信息
|
||||||
function _M.getUser(id)
|
function _M.getUser(id)
|
||||||
--组装sql语句
|
--组装sql语句
|
||||||
local sql = "select * from \"T_Users\" where id='"..id.."'"
|
local sql = "select * from \"tbl_users\" where id='"..id.."'"
|
||||||
return execSQL(sql)
|
return execSQL(sql)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -131,14 +131,14 @@ function _M.addUser(jsonData)
|
||||||
local newKeys = keys.."id"
|
local newKeys = keys.."id"
|
||||||
local newValues = values.."'"..getUuid().."'"
|
local newValues = values.."'"..getUuid().."'"
|
||||||
--组装sql语句
|
--组装sql语句
|
||||||
local sql = string.format("insert into \"T_Users\"(%s)values(%s)", newKeys, newValues)
|
local sql = string.format("insert into \"tbl_users\"(%s)values(%s)", newKeys, newValues)
|
||||||
return execSQL(sql)
|
return execSQL(sql)
|
||||||
end
|
end
|
||||||
|
|
||||||
--增加用户信息到数据表
|
--增加用户信息到数据表
|
||||||
function _M.delete_user(id)
|
function _M.delete_user(id)
|
||||||
--组装sql语句
|
--组装sql语句
|
||||||
local sql = "delete from \"T_Users\" where id='"..id.."'"
|
local sql = "delete from \"tbl_users\" where id='"..id.."'"
|
||||||
return execSQL(sql)
|
return execSQL(sql)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user