This commit is contained in:
knowpia
2022-09-13 13:24:02 +08:00
parent 09b89750f5
commit c808d0fa44

View File

@@ -61,10 +61,11 @@ class Article
$where = "userid={$userid} and id<".$lastIndex; $where = "userid={$userid} and id<".$lastIndex;
} }
$result["lastIndex"] = 0; $result["lastIndex"] = 0;
$result["list"] = [];
$list = Db::name("app_article")->where($where)->order("id desc")->order('id desc')->limit(env("page_count"))->select()->toArray(); $list = Db::name("app_article")->where($where)->order("id desc")->order('id desc')->limit(env("page_count"))->select()->toArray();
foreach($list as $vo){ foreach($list as $vo){
$result['lastIndex'] = $vo['id']; $result['lastIndex'] = $vo['id'];
$result["list"][] = $vo; $result["data"][] = $vo;
} }
if(count($list)<env("PAGE_COUNT")){ if(count($list)<env("PAGE_COUNT")){
$result["lastIndex"] = 0; $result["lastIndex"] = 0;