1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00

add publish field

This commit is contained in:
Xuan Sang LE 2018-02-27 01:09:20 +01:00
parent b6b3d8dcb3
commit 3e93fa4f6c

View File

@ -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