mirror of
https://github.com/lxsang/antd-web-apps
synced 2024-12-27 01:48:21 +01:00
add publish field
This commit is contained in:
parent
b6b3d8dcb3
commit
3e93fa4f6c
12
blog/api.lua
12
blog/api.lua
@ -1,8 +1,16 @@
|
||||
local get = {}
|
||||
get.fetch = function(user, exp, limit)
|
||||
get.fetch = function(user, cnd, limit)
|
||||
local db = require("db.model").get(user,"blogs",nil)
|
||||
if not db then return nil end
|
||||
local cond = { exp = exp, order = { ctime = "DESC" }}
|
||||
local exp = {}
|
||||
exp[1] = {["="] = { publish = 1 }}
|
||||
if cnd then
|
||||
exp[2] = cnd
|
||||
else
|
||||
|
||||
end
|
||||
|
||||
local cond = { exp = {["and"] = exp }, order = { ctime = "DESC" }}
|
||||
if limit then
|
||||
cond.limit = limit
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user