1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-07-27 02:59:47 +02:00

WIP: make code compatible with new SILK API
All checks were successful
gitea-sync/antd-web-apps/pipeline/head This commit looks good

This commit is contained in:
DanyLE
2023-04-26 18:51:03 +02:00
parent 93b6ca18ad
commit a76942f2f3
60 changed files with 1527 additions and 2845 deletions

View File

@ -9,5 +9,8 @@ BaseModel:subclass("AnalyticalModel",{
})
function AnalyticalModel:similarof(id)
return self:find({ exp = {["="] = {pid = id}}, order = {score = "DESC"}})
return self:find({
where = {pid = id},
order = { "score$desc"}
})
end

View File

@ -15,28 +15,27 @@ BaseModel:subclass("BlogModel",{
})
function BlogModel:fetch(cnd, limit, order)
local exp = {}
exp[1] = {["="] = { publish = 1 }}
if cnd then
exp[2] = cnd
else
end
local cond = {
exp = {["and"] = exp },
order = { ctime = "DESC" },
local filter = {
order = { "ctime$desc" },
fields = {
"id", "title", "utime", "ctime", "utimestr", "content", "ctimestr", "rendered", "tags"
}
}
}
if limit then
cond.limit = limit
filter.limit = limit
end
if order then
cond.order = order
filter.order = order
end
return self:find(cond)
filter.where = {}
if cnd then
filter.where = cnd
end
filter.where.publish = 1
return self:find(filter)
end
function BlogModel:minid()