From 06cc3caf77090747193be2b1b582305cf475df2d Mon Sep 17 00:00:00 2001 From: taoser Date: Sun, 14 Apr 2024 12:10:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=83=AD=E5=B8=96delete=5Fti?= =?UTF-8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/Article.php | 13 ++++++------- app/index/controller/User.php | 2 +- config/taoler.php | 2 +- vendor/taoser/think-addons/src/helper.php | 6 ++++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/app/common/model/Article.php b/app/common/model/Article.php index db89579..1d5b606 100644 --- a/app/common/model/Article.php +++ b/app/common/model/Article.php @@ -116,7 +116,7 @@ class Article extends Model ->where('id', 'in', $topIdArr) ->with([ 'cate' => function (Query $query) { - $query->where('delete_time', 0)->field('id,catename,ename'); + $query->field('id,catename,ename'); }, 'user' => function (Query $query) { $query->field('id,name,nickname,user_img'); @@ -143,7 +143,7 @@ class Article extends Model $data = $this::field('id,title,title_color,cate_id,user_id,content,create_time,is_hot,pv,jie,upzip,has_img,has_video,has_audio,read_type,art_pass') ->with([ 'cate' => function(Query $query){ - $query->where('delete_time',0)->field('id,catename,ename,detpl'); + $query->field('id,catename,ename,detpl'); }, 'user' => function(Query $query){ $query->field('id,name,nickname,user_img'); @@ -173,8 +173,7 @@ class Article extends Model { return Cache::remember('article_hot', function() use($num){ $comments = Comment::field('article_id,count(*) as count') - ->where('comment.delete_time',0) - ->hasWhere('article',['status' =>1, 'delete_time' => 0]) + ->hasWhere('article',['status' => 1]) ->group('article_id') ->order('count','desc') ->limit($num) @@ -229,7 +228,7 @@ class Article extends Model ->where(['status'=>1]) ->with([ 'cate' => function(Query $query){ - $query->where('delete_time',0)->field('id,catename,ename'); + $query->field('id,catename,ename'); }, 'user' => function(Query $query){ $query->field('id,name,nickname,user_img,area_id,vip,city')->withCount(['article','comments']); @@ -319,7 +318,7 @@ class Article extends Model public function getUserArtList(int $id) { $userArtList = $this::field('id,cate_id,title,create_time,pv,is_hot') ->with(['cate' => function($query){ - $query->where(['delete_time'=>0,'status'=>1])->field('id,ename'); + $query->where(['status'=>1])->field('id,ename'); }]) ->where(['user_id' => $id,'status' => 1]) ->order('id','desc') @@ -368,7 +367,7 @@ class Article extends Model ->with(['user' => function($query){ $query->field('id,name,nickname,user_img,area_id,vip'); },'cate' => function($query){ - $query->where('delete_time',0)->field('id,catename,ename'); + $query->field('id,catename,ename'); }]) ->where(['status'=>1]) ->order('id desc') diff --git a/app/index/controller/User.php b/app/index/controller/User.php index 0e46263..af2d20b 100644 --- a/app/index/controller/User.php +++ b/app/index/controller/User.php @@ -302,7 +302,7 @@ class User extends BaseController { //用户 $u = Db::name('user')->field('name,nickname,city,sex,sign,user_img,point,vip,create_time')->find($id); - + $article = new Article(); $arts = $article->getUserArtList((int) $id); diff --git a/config/taoler.php b/config/taoler.php index f73a77e..5ee1545 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -16,7 +16,7 @@ return [ // 应用名,此项不可更改 'appname' => 'TaoLer', // 版本配置 - 'version' => '2.5.6', + 'version' => '2.5.7', // 加盐 'salt' => 'taoler', // 数据库备份目录 diff --git a/vendor/taoser/think-addons/src/helper.php b/vendor/taoser/think-addons/src/helper.php index 78ed243..a1e6954 100644 --- a/vendor/taoser/think-addons/src/helper.php +++ b/vendor/taoser/think-addons/src/helper.php @@ -24,8 +24,10 @@ define('DS', DIRECTORY_SEPARATOR); spl_autoload_register(function ($class) { $class = ltrim($class, '\\'); - - $dir = App::getRootPath(); + + //$dir = App::getRootPath(); + $root_path = str_replace('\\','/', dirname(__DIR__)); + $dir = strstr($root_path, 'vendor', true); $namespace = 'addons'; if (strpos($class, $namespace) === 0) {