From f4eec7077fe8d3e474f0f1d4e180c83c5b48bcd7 Mon Sep 17 00:00:00 2001 From: knowpia <9812993@qq.com> Date: Tue, 13 Sep 2022 15:48:46 +0800 Subject: [PATCH] fix bug --- app/controller/Article.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controller/Article.php b/app/controller/Article.php index 29bd643..afb8bdf 100644 --- a/app/controller/Article.php +++ b/app/controller/Article.php @@ -54,7 +54,7 @@ class Article if(empty($userid)){ return show("请登录后操作!",NEED_LOGIN); } - $lastIndex = empty($GLOBALS['data']['data']["lastindex"])?0:$GLOBALS['data']['data']["lastindex"]; + $lastIndex = empty($GLOBALS['data']['data']["lastindex"])?0:$GLOBALS['data']['data']["lastindex"]; if($lastIndex == 0){ $where = "userid={$userid} and id>0"; }else{ @@ -62,7 +62,8 @@ class Article } $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')->limit(env("page_count"))->select()->toArray(); + print_r($list); foreach($list as $vo){ $result['lastIndex'] = $vo['id']; $result["list"][] = $vo;