From 4042239db9d7cba9c0682619eff252a9fcd14720 Mon Sep 17 00:00:00 2001 From: tao Date: Fri, 7 Jan 2022 14:45:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- app/common/model/Article.php | 19 +- app/common/model/Comment.php | 2 +- app/index/controller/Article.php | 62 ++--- app/index/route/route.php | 18 +- composer.lock | 47 ++-- config/taoler.php | 2 +- vendor/composer/installed.json | 57 +++-- vendor/composer/installed.php | 30 +-- vendor/services.php | 2 +- vendor/symfony/polyfill-mbstring/Mbstring.php | 5 +- .../symfony/polyfill-mbstring/composer.json | 3 + .../Resources/stubs/UnhandledMatchError.php | 6 +- .../Resources/stubs/ValueError.php | 6 +- vendor/topthink/think-orm/src/Model.php | 28 --- .../topthink/think-orm/src/db/BaseQuery.php | 14 +- vendor/topthink/think-orm/src/db/Mongo.php | 6 +- .../src/db/concern/ModelRelationQuery.php | 237 +++++++++++++----- .../src/db/concern/ResultOperation.php | 38 ++- .../think-orm/src/model/concern/Attribute.php | 39 ++- .../src/model/concern/RelationShip.php | 5 +- view/taoler/index/article/ask/cate.html | 19 +- view/taoler/index/article/ask/detail.html | 5 +- view/taoler/index/article/cate.html | 9 +- view/taoler/index/article/posts/cate.html | 31 +-- view/taoler/index/article/posts/detail.html | 5 +- view/taoler/index/index/index.html | 2 +- view/taoler/index/public/base.html | 2 +- view/taoler/index/public/filter.html | 8 +- 29 files changed, 366 insertions(+), 345 deletions(-) diff --git a/README.md b/README.md index 92d839f..21e054a 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ > TaoLer是一个简单迅捷的轻论坛系统,适用于个人或组织区域型信息交流发布平台。 * 官网:https://www.aieok.com - * 版本:TaoLer 1.8.18 - * 日期:2021.12.30 + * 版本:TaoLer 1.8.20 + * 日期:2022.1.7 webman版新架构已适配90% diff --git a/app/common/model/Article.php b/app/common/model/Article.php index b394ce8..08d8729 100644 --- a/app/common/model/Article.php +++ b/app/common/model/Article.php @@ -191,12 +191,10 @@ class Article extends Model * @param string $ename 分类英文名 * @param string $type all\top\hot\jie 分类类型 * @param int $page 页面 - * @param string $url - * @param string $suffix * @return mixed|\think\Paginator * @throws \think\db\exception\DbException */ - public function getCateList(string $ename, string $type, int $page, string $url, string $suffix) + public function getCateList(string $ename, string $type, int $page = 1) { $where = []; $cateId = Cate::where('ename',$ename)->value('id'); @@ -224,8 +222,7 @@ class Article extends Model ])->withCount(['comments'])->where(['status'=>1,'jie'=>1])->where($where)->order(['is_top'=>'desc','create_time'=>'desc']) ->paginate([ 'list_rows' => 15, - 'page' => $page, - 'path' =>$url.'[PAGE]'.$suffix + 'page' => $page ])->toArray(); break; @@ -240,8 +237,7 @@ class Article extends Model ])->withCount(['comments'])->where('status',1)->where($where)->where('is_hot',1)->order(['is_top'=>'desc','create_time'=>'desc']) ->paginate([ 'list_rows' => 15, - 'page' => $page, - 'path' =>$url.'[PAGE]'.$suffix + 'page' => $page ])->toArray(); break; @@ -256,8 +252,7 @@ class Article extends Model ])->withCount(['comments'])->where('status',1)->where($where)->where('is_top',1)->order(['is_top'=>'desc','create_time'=>'desc']) ->paginate([ 'list_rows' => 15, - 'page' => $page, - 'path' =>$url.'[PAGE]'.$suffix + 'page' => $page ])->toArray(); break; @@ -272,8 +267,7 @@ class Article extends Model ])->withCount(['comments'])->where('status',1)->where($where)->where('jie',0)->order(['is_top'=>'desc','create_time'=>'desc']) ->paginate([ 'list_rows' => 15, - 'page' => $page, - 'path' =>$url.'[PAGE]'.$suffix + 'page' => $page ])->toArray(); break; @@ -288,8 +282,7 @@ class Article extends Model ])->withCount(['comments'])->where('status',1)->where($where)->order(['is_top'=>'desc','create_time'=>'desc']) ->paginate([ 'list_rows' => 15, - 'page' => $page, - 'path' =>$url.'[PAGE]'.$suffix + 'page' => $page ])->toArray(); break; } diff --git a/app/common/model/Comment.php b/app/common/model/Comment.php index 30f247c..8390cc9 100644 --- a/app/common/model/Comment.php +++ b/app/common/model/Comment.php @@ -40,7 +40,7 @@ class Comment extends Model { $res = Cache::get('reply'); if(!$res){ - $user = User::withCount('comments')->order(['comments_count'=>'desc','last_login_time'=>'desc'])->limit($num)->select(); + $user = User::withCount('comments')->order(['comments_count'=>'desc','last_login_time'=>'desc'])->limit($num)->select()->toArray(); if($user) { $res['status'] = 0; diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 84e3044..d58eca9 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -29,54 +29,22 @@ class Article extends BaseController // 抛出 HTTP 异常 throw new \think\exception\HttpException(404, '请求异常'); } - $page = Request::param('page') ? Request::param('page') : 1; - - //获取分类ID - $ename = Request::param('ename'); + //动态参数 + $ename = Request::param('ename') ?? 'all'; $type = Request::param('type') ?? 'all'; + $page = Request::param('page') ? Request::param('page') : 1; $tpl = Db::name('cate')->where('ename',$ename)->value('detpl'); - //分页伪静态 - //$str = Request::baseUrl(); //不带参数在url - $path = Request::pathinfo(); - $str = '/'.app('http')->getName().'/'.$path; - //halt($str); - - $patterns = "/\d+/"; //数字正则 - $p = preg_match($patterns,$str,$arr); //正则查询页码出现在位置 + //分页url + $url = url('cate_page',['ename'=>$ename,'type'=>$type,'page'=>$page]); + //返回最后/前面的字符串 + $path = substr($url,0,strrpos($url,"/")); - //检测route配置中是否设置了伪静态后缀 - $suffix = Config::get('route.url_html_suffix') ? '.'.Config::get('route.url_html_suffix') : '/'; - if(Config::get('route.url_html_suffix')){ - - //伪静态有后缀 - if(isset($arr[0])){ - $page = $arr[0]; - $url = strstr($str,$arr[0],true); - } else { - $page = 1; - $url = strstr($str,'.html',true); - } - } else { - - //伪静态后缀false - if(isset($arr[0])){ - $page = $arr[0]; - $url = strstr($str,$arr[0],true); - } else { - $page = 1; - $url = $str.'/'; - } - } - //分类列表 $article = new ArticleModel(); - $artList = $article->getCateList($ename,$type,$page,$url,$suffix); - - //$count = $artList->total(); + $artList = $article->getCateList($ename,$type,$page); // 热议文章 $artHot = $article->getArtHot(10); - //广告 $ad = new Slider(); //分类图片 @@ -84,12 +52,12 @@ class Article extends BaseController //分类钻展赞助 $ad_comm = $ad->getSliderList(6); - View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cateImg'=>$ad_cateImg,'ad_comm'=>$ad_comm,'jspage'=>'jie','url'=>$url]); + View::assign(['type'=>$type,'artList'=>$artList,'artHot'=>$artHot,'ad_cateImg'=>$ad_cateImg,'ad_comm'=>$ad_comm,'jspage'=>'jie','ename'=>$ename,'path'=>$path]); return View::fetch('article/'.$tpl.'/cate'); } //文章详情页 - public function detail($id) + public function detail() { $id = input('id'); $artStu = Db::name('article')->field('id')->where(['status'=>1,'delete_time'=>0])->find($id); @@ -114,8 +82,7 @@ class Article extends BaseController $pv = Db::name('article')->field('pv')->where('id',$id)->value('pv'); //评论 - $comment = new Comment; - $comments = $comment->getComment($id, $page); + $comments = $this->getComments($id, $page); // 热议文章 $artHot = $article->getArtHot(10); @@ -130,6 +97,13 @@ class Article extends BaseController return View::fetch('article/'.$tpl.'/detail'); } + //评论内容 + public function getComments($id, $page) + { + $comment = new Comment; + return $comment->getComment($id, $page); + } + //文章评论 public function comment() { diff --git a/app/index/route/route.php b/app/index/route/route.php index 0ccc603..3391010 100644 --- a/app/index/route/route.php +++ b/app/index/route/route.php @@ -14,17 +14,19 @@ Route::get('captcha/[:config]','\\think\\captcha\\CaptchaController@index'); Route::rule('/', 'index'); // 首页访问路由 Route::group(function () { Route::get('jie/:id', 'article/detail'); - //Route::get('column/','article/cate'); - //Route::get('column//','article/cate'); - Route::get('column//[:type]/[:page]','article/cate') - ->pattern([ - 'ename' => '\w+', - 'page' => '\d+', - ]); + Route::get('column/$','article/cate'); + Route::get('column//$', 'article/cate')->name('cate_type'); + Route::rule('column///', 'article/cate')->name('cate_page'); Route::rule('add','Article/add'); Route::rule('edit/[:id]','Article/edit'); //Route::rule('del/:id','article/delete'); -}); +})->pattern([ + 'ename' => '\w+', + 'type' => '\w+', + 'page' => '\d+', + 'id' => '\d+', + ]); + Route::group(function () { Route::rule('u/:id', 'user/home'); }); diff --git a/composer.lock b/composer.lock index a5bd2d3..30bc6ac 100644 --- a/composer.lock +++ b/composer.lock @@ -826,7 +826,7 @@ }, { "name": "topthink/framework", - "version": "v6.0.10", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", @@ -893,7 +893,7 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.10" + "source": "https://github.com/top-think/framework/tree/v6.0.11" }, "time": "2021-12-31T09:14:28+00:00" }, @@ -1064,16 +1064,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.47", + "version": "v2.0.50", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "e69151fba9dd21f86e392a0ae208825904d6d49a" + "reference": "091ad5e023c15fcce4ceaea2f3814bdf71045cde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/e69151fba9dd21f86e392a0ae208825904d6d49a", - "reference": "e69151fba9dd21f86e392a0ae208825904d6d49a", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/091ad5e023c15fcce4ceaea2f3814bdf71045cde", + "reference": "091ad5e023c15fcce4ceaea2f3814bdf71045cde", "shasum": "", "mirrors": [ { @@ -1119,9 +1119,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.47" + "source": "https://github.com/top-think/think-orm/tree/v2.0.50" }, - "time": "2021-12-31T06:12:13+00:00" + "time": "2022-01-06T02:48:16+00:00" }, { "name": "topthink/think-template", @@ -1272,16 +1272,16 @@ "packages-dev": [ { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "", "mirrors": [ { @@ -1293,6 +1293,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -1338,7 +1341,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -1354,11 +1357,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -1420,7 +1423,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -1440,16 +1443,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "", "mirrors": [ { @@ -1509,7 +1512,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -1525,7 +1528,7 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-09-13T13:58:33+00:00" }, { "name": "symfony/var-dumper", diff --git a/config/taoler.php b/config/taoler.php index c65cb27..db3d034 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -7,7 +7,7 @@ return [ //应用名,此项不可更改 'appname' => 'TaoLer', //版本配置 - 'version' => '1.8.17', + 'version' => '1.8.20', //加盐 'salt' => 'taoler', //数据库备份目录 diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3bdd25d..d54dfde 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -722,17 +722,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "", "mirrors": [ { @@ -744,10 +744,13 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-05-27T12:26:48+00:00", + "time": "2021-11-30T18:21:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -791,7 +794,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -811,8 +814,8 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -876,7 +879,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -896,17 +899,17 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "version_normalized": "1.23.1.0", + "version": "v1.24.0", + "version_normalized": "1.24.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "", "mirrors": [ { @@ -918,7 +921,7 @@ "require": { "php": ">=7.1" }, - "time": "2021-07-28T13:41:28+00:00", + "time": "2021-09-13T13:58:33+00:00", "type": "library", "extra": { "branch-alias": { @@ -968,7 +971,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -1209,8 +1212,8 @@ }, { "name": "topthink/framework", - "version": "v6.0.10", - "version_normalized": "6.0.10.0", + "version": "v6.0.11", + "version_normalized": "6.0.11.0", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", @@ -1279,7 +1282,7 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.10" + "source": "https://github.com/top-think/framework/tree/v6.0.11" }, "install-path": "../topthink/framework" }, @@ -1451,17 +1454,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.47", - "version_normalized": "2.0.47.0", + "version": "v2.0.50", + "version_normalized": "2.0.50.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "e69151fba9dd21f86e392a0ae208825904d6d49a" + "reference": "091ad5e023c15fcce4ceaea2f3814bdf71045cde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/e69151fba9dd21f86e392a0ae208825904d6d49a", - "reference": "e69151fba9dd21f86e392a0ae208825904d6d49a", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/091ad5e023c15fcce4ceaea2f3814bdf71045cde", + "reference": "091ad5e023c15fcce4ceaea2f3814bdf71045cde", "shasum": "", "mirrors": [ { @@ -1481,7 +1484,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2021-12-31T06:12:13+00:00", + "time": "2022-01-06T02:48:16+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1509,7 +1512,7 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.47" + "source": "https://github.com/top-think/think-orm/tree/v2.0.50" }, "install-path": "../topthink/think-orm" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index ef8beb6..b9ddcc9 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'f35436abc461b29e7056f63f10302c84aeb2bfbc', + 'reference' => '83ca563d1c45da13aef6d32918bfb64b5cc2a935', 'name' => 'taoser/taoler', 'dev' => true, ), @@ -110,17 +110,17 @@ 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', + 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 'dev_requirement' => true, ), 'symfony/polyfill-php72' => array( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), @@ -128,12 +128,12 @@ 'dev_requirement' => true, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.23.1', - 'version' => '1.23.1.0', + 'pretty_version' => 'v1.24.0', + 'version' => '1.24.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', + 'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9', 'dev_requirement' => true, ), 'symfony/var-dumper' => array( @@ -151,7 +151,7 @@ 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'f35436abc461b29e7056f63f10302c84aeb2bfbc', + 'reference' => '83ca563d1c45da13aef6d32918bfb64b5cc2a935', 'dev_requirement' => false, ), 'taoser/think-addons' => array( @@ -173,8 +173,8 @@ 'dev_requirement' => false, ), 'topthink/framework' => array( - 'pretty_version' => 'v6.0.10', - 'version' => '6.0.10.0', + 'pretty_version' => 'v6.0.11', + 'version' => '6.0.11.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/framework', 'aliases' => array(), @@ -209,12 +209,12 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.47', - 'version' => '2.0.47.0', + 'pretty_version' => 'v2.0.50', + 'version' => '2.0.50.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), - 'reference' => 'e69151fba9dd21f86e392a0ae208825904d6d49a', + 'reference' => '091ad5e023c15fcce4ceaea2f3814bdf71045cde', 'dev_requirement' => false, ), 'topthink/think-template' => array( diff --git a/vendor/services.php b/vendor/services.php index beea780..6909750 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'taoser\\addons\\Service', diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index b599095..b65c54a 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -80,7 +80,7 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -602,6 +602,9 @@ final class Mbstring if (80000 > \PHP_VERSION_ID) { return false; } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); } diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index 2ed7a74..1fa21ca 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -18,6 +18,9 @@ "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" ] diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php index 7fb2000..37937cb 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -1,5 +1,7 @@ filter(function ($result, $options) { - // 关联查询 - if (!empty($options['relation'])) { - $result->relationQuery($options['relation'], $options['with_relation_attr']); - } - - // 预载入查询 - if (empty($options['is_resultSet']) && !empty($options['with'])) { - $result->eagerlyResult($result, $options['with'], $options['with_relation_attr'], false, $options['with_cache'] ?? false); - } - - // JOIN预载入查询 - if (empty($options['is_resultSet']) && !empty($options['with_join'])) { - $result->eagerlyResult($result, $options['with_join'], $options['with_relation_attr'], true, $options['with_cache'] ?? false); - } - - // 关联统计 - if (!empty($options['with_count'])) { - foreach ($options['with_count'] as $val) { - $result->relationCount($this, (array) $val[0], $val[1], $val[2], false); - } - } - }); // 执行初始化操作 $this->initialize(); } @@ -308,11 +285,6 @@ abstract class Model implements JsonSerializable, ArrayAccess, Arrayable, Jsonab $model->setUpdateWhere($where); - // 查询数据处理 - foreach ($this->filter as $filter) { - call_user_func_array($filter, [$model, $options]); - } - $model->trigger('AfterRead'); return $model; diff --git a/vendor/topthink/think-orm/src/db/BaseQuery.php b/vendor/topthink/think-orm/src/db/BaseQuery.php index 63b8d22..7bb778a 100644 --- a/vendor/topthink/think-orm/src/db/BaseQuery.php +++ b/vendor/topthink/think-orm/src/db/BaseQuery.php @@ -106,12 +106,6 @@ abstract class BaseQuery $name = Str::snake(substr($method, 5)); array_unshift($args, $name); return call_user_func_array([$this, 'where'], $args); - } elseif ($this->model && in_array($method, ['hidden', 'visible', 'append'])) { - // 调用模型类方法 - $this->model->filter(function ($model, $options) use ($method, $args) { - call_user_func_array([$model, $method], $args); - }); - return $this; } elseif ($this->model && method_exists($this->model, 'scope' . $method)) { // 动态调用命名范围 $method = 'scope' . $method; @@ -284,9 +278,11 @@ abstract class BaseQuery public function column($field, string $key = ''): array { $result = $this->connection->column($this, $field, $key); + if (count($result) != count($result, 1)) { $this->resultSet($result, false); } + return $result; } @@ -1158,7 +1154,7 @@ abstract class BaseQuery if (!empty($this->model)) { // 返回模型对象 - $this->resultToModel($result, $this->options); + $this->resultToModel($result); } else { $this->result($result); } @@ -1187,7 +1183,7 @@ abstract class BaseQuery $this->parseView($options); } - foreach (['data', 'order', 'join', 'union', 'filter', 'json'] as $name) { + foreach (['data', 'order', 'join', 'union', 'filter', 'json', 'with_attr', 'with_relation_attr'] as $name) { if (!isset($options[$name])) { $options[$name] = []; } @@ -1197,7 +1193,7 @@ abstract class BaseQuery $options['strict'] = $this->connection->getConfig('fields_strict'); } - foreach (['master', 'lock', 'fetch_sql', 'array', 'distinct', 'procedure'] as $name) { + foreach (['master', 'lock', 'fetch_sql', 'array', 'distinct', 'procedure', 'with_cache'] as $name) { if (!isset($options[$name])) { $options[$name] = false; } diff --git a/vendor/topthink/think-orm/src/db/Mongo.php b/vendor/topthink/think-orm/src/db/Mongo.php index 5e8a09a..cf6e9c4 100644 --- a/vendor/topthink/think-orm/src/db/Mongo.php +++ b/vendor/topthink/think-orm/src/db/Mongo.php @@ -630,7 +630,7 @@ class Mongo extends BaseQuery $options['table'] = $this->getTable(); } - foreach (['where', 'data'] as $name) { + foreach (['where', 'data', 'projection', 'filter', 'json', 'with_attr', 'with_relation_attr'] as $name) { if (!isset($options[$name])) { $options[$name] = []; } @@ -649,10 +649,6 @@ class Mongo extends BaseQuery $options['modifiers'] = $modifiers; } - if (!isset($options['projection'])) { - $options['projection'] = []; - } - if (!isset($options['typeMap'])) { $options['typeMap'] = $this->getConfig('type_map'); } diff --git a/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php b/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php index 3213f75..0015a24 100644 --- a/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php +++ b/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php @@ -51,6 +51,45 @@ trait ModelRelationQuery return $this->model; } + /** + * 设置需要隐藏的输出属性 + * @access public + * @param array $hidden 属性列表 + * @return $this + */ + public function hidden(array $hidden = []) + { + $this->options['hidden'] = $hidden; + + return $this; + } + + /** + * 设置需要输出的属性 + * @access public + * @param array $visible + * @return $this + */ + public function visible(array $visible = []) + { + $this->options['visible'] = $visible; + + return $this; + } + + /** + * 设置需要附加的输出属性 + * @access public + * @param array $append 属性列表 + * @return $this + */ + public function append(array $append = []) + { + $this->options['append'] = $append; + + return $this; + } + /** * 添加查询范围 * @access public @@ -94,10 +133,11 @@ trait ModelRelationQuery */ public function relation(array $relation) { - if (!empty($relation)) { - $this->options['relation'] = $relation; + if (empty($this->model) || empty($relation)) { + return $this; } + $this->options['relation'] = $relation; return $this; } @@ -139,21 +179,33 @@ trait ModelRelationQuery /** * 设置数据字段获取器 * @access public - * @param string|array $name 字段名 - * @param callable $callback 闭包获取器 + * @param string|array $name 字段名 + * @param callable $callback 闭包获取器 * @return $this */ public function withAttr($name, callable $callback = null) { if (is_array($name)) { - $this->options['with_attr'] = $name; - } else { - $this->options['with_attr'][$name] = $callback; + foreach ($name as $key => $val) { + $this->withAttr($key, $val); + } + return $this; } - return $this->filter(function ($result) { - return $this->getResultAttr($result, $this->options['with_attr']); - }, 'with_attr'); + $this->options['with_attr'][$name] = $callback; + + if (strpos($name, '.')) { + [$relation, $field] = explode('.', $name); + + if (!empty($this->options['json']) && in_array($relation, $this->options['json'])) { + + } else { + $this->options['with_relation_attr'][$relation][$field] = $callback; + unset($this->options['with_attr'][$name]); + } + } + + return $this; } /** @@ -164,10 +216,11 @@ trait ModelRelationQuery */ public function with($with) { - if (!empty($with)) { - $this->options['with'] = (array) $with; + if (empty($this->model) || empty($with)) { + return $this; } + $this->options['with'] = (array) $with; return $this; } @@ -180,7 +233,7 @@ trait ModelRelationQuery */ public function withJoin($with, string $joinType = '') { - if (empty($with)) { + if (empty($this->model) || empty($with)) { return $this; } @@ -212,7 +265,6 @@ trait ModelRelationQuery } $this->via(); - $this->options['with_join'] = $with; return $this; @@ -229,16 +281,20 @@ trait ModelRelationQuery */ protected function withAggregate($relations, string $aggregate = 'count', $field = '*', bool $subQuery = true) { - if (!$subQuery) { - $this->options['with_count'][] = [$relations, $aggregate, $field]; - } else { - if (!isset($this->options['field'])) { - $this->field('*'); - } - - $this->model->relationCount($this, (array) $relations, $aggregate, $field, true); + if (empty($this->model)) { + return $this; } + if (!$subQuery) { + $this->options['with_aggregate'][] = [(array) $relations, $aggregate, $field]; + return $this; + } + + if (!isset($this->options['field'])) { + $this->field('*'); + } + + $this->model->relationCount($this, (array) $relations, $aggregate, $field, true); return $this; } @@ -253,6 +309,10 @@ trait ModelRelationQuery */ public function withCache($relation = true, $key = true, $expire = null, string $tag = null) { + if (empty($this->model)) { + return $this; + } + if (false === $relation || false === $key || !$this->getConnection()->getCache()) { return $this; } @@ -372,6 +432,32 @@ trait ModelRelationQuery return $this->model->hasWhere($relation, $where, $fields, $joinType, $this); } + /** + * JSON字段数据转换 + * @access protected + * @param array $result 查询数据 + * @return void + */ + protected function jsonModelResult(array &$result): void + { + $withAttr = $this->options['with_attr']; + foreach ($this->options['json'] as $name) { + if (!isset($result[$name])) { + continue; + } + + $jsonData = json_decode($result[$name], true); + + if (isset($withAttr[$name])) { + foreach ($withAttr[$name] as $key => $closure) { + $jsonData[$key] = $closure($jsonData[$key] ?? null, $jsonData); + } + } + + $result[$name] = !$this->options['json_assoc'] ? (object) $jsonData : $jsonData; + } + } + /** * 查询数据转换为模型数据集对象 * @access protected @@ -384,20 +470,24 @@ trait ModelRelationQuery return $this->model->toCollection(); } - $withRelationAttr = $this->getWithRelationAttr(); + $this->options['is_resultSet'] = true; + foreach ($resultSet as $key => &$result) { // 数据转换为模型对象 - $this->resultToModel($result, $this->options, true); + $this->resultToModel($result); } - if (!empty($this->options['with'])) { - // 预载入 - $result->eagerlyResultSet($resultSet, $this->options['with'], $withRelationAttr, false, $this->options['with_cache'] ?? false); - } - - if (!empty($this->options['with_join'])) { - // 预载入 - $result->eagerlyResultSet($resultSet, $this->options['with_join'], $withRelationAttr, true, $this->options['with_cache'] ?? false); + foreach (['with', 'with_join'] as $with) { + // 关联预载入 + if (!empty($this->options[$with])) { + $result->eagerlyResultSet( + $resultSet, + $this->options[$with], + $this->options['with_relation_attr'], + 'with_join' == $with ? true : false, + $this->options['with_cache'] ?? false + ); + } } // 模型数据集转换 @@ -405,55 +495,68 @@ trait ModelRelationQuery } /** - * 检查动态获取器 + * 查询数据转换为模型对象 * @access protected - * @return array + * @param array $result 查询数据 + * @return void */ - protected function getWithRelationAttr(): array + protected function resultToModel(array &$result): void { - if (isset($this->options['with_relation_attr'])) { - return $this->options['with_relation_attr']; + // JSON数据处理 + if (!empty($this->options['json'])) { + $this->jsonModelResult($result); } - $withRelationAttr = []; - if (!empty($this->options['with_attr'])) { - foreach ($this->options['with_attr'] as $name => $val) { - if (strpos($name, '.')) { - [$relation, $field] = explode('.', $name); + $result = $this->model->newInstance( + $result, + !empty($this->options['is_resultSet']) ? null : $this->getModelUpdateCondition($this->options), + $this->options + ); - $withRelationAttr[$relation][$field] = $val; - unset($this->options['with_attr'][$name]); + // 模型数据处理 + foreach ($this->options['filter'] as $filter) { + call_user_func_array($filter, [$result, $this->options]); + } + + // 关联查询 + if (!empty($this->options['relation'])) { + $result->relationQuery($this->options['relation'], $this->options['with_relation_attr']); + } + + // 关联预载入查询 + if (empty($this->options['is_resultSet'])) { + foreach (['with', 'with_join'] as $with) { + if (!empty($this->options[$with])) { + $result->eagerlyResult( + $this->options[$with], + $this->options['with_relation_attr'], + 'with_join' == $with ? true : false, + $this->options['with_cache'] ?? false + ); } } } - $this->options['with_relation_attr'] = $withRelationAttr; - return $withRelationAttr; - } - - /** - * 查询数据转换为模型对象 - * @access protected - * @param array $result 查询数据 - * @param array $options 查询参数 - * @param bool $resultSet 是否为数据集查询 - * @return void - */ - protected function resultToModel(array &$result, array $options = [], bool $resultSet = false): void - { - $options['with_relation_attr'] = $this->getWithRelationAttr(); - $options['is_resultSet'] = $resultSet; - - // JSON 数据处理 - if (!empty($options['json'])) { - $this->jsonResult($result, $options['json'], $options['json_assoc'], $options['with_relation_attr']); + // 关联统计查询 + if (!empty($this->options['with_aggregate'])) { + foreach ($this->options['with_aggregate'] as $val) { + $result->relationCount($this, $val[0], $val[1], $val[2], false); + } } - foreach ($this->options['filter'] as $filter) { - $result = call_user_func($filter, $result); + // 动态获取器 + if (!empty($this->options['with_attr'])) { + $result->withAttr($this->options['with_attr']); } - $result = $this->model->newInstance($result, $resultSet ? null : $this->getModelUpdateCondition($options), $options); + foreach (['hidden', 'visible', 'append'] as $name) { + if (!empty($this->options[$name])) { + $result->$name($this->options[$name]); + } + } + + // 刷新原始数据 + $result->refreshOrigin(); } /** diff --git a/vendor/topthink/think-orm/src/db/concern/ResultOperation.php b/vendor/topthink/think-orm/src/db/concern/ResultOperation.php index d8b5a4c..ea26916 100644 --- a/vendor/topthink/think-orm/src/db/concern/ResultOperation.php +++ b/vendor/topthink/think-orm/src/db/concern/ResultOperation.php @@ -27,7 +27,7 @@ use think\Model; trait ResultOperation { /** - * 设置数据处理 + * 设置数据处理(支持模型) * @access public * @param callable $filter 数据处理Callable * @param string $index 索引(唯一) @@ -75,12 +75,19 @@ trait ResultOperation */ protected function result(array &$result): void { + // JSON数据处理 if (!empty($this->options['json'])) { - $this->jsonResult($result, $this->options['json'], true); + $this->jsonResult($result); } + // 查询数据处理 foreach ($this->options['filter'] as $filter) { - $result = call_user_func($filter, $result); + $result = call_user_func_array($filter, [$result, $this->options]); + } + + // 获取器 + if (!empty($this->options['with_attr'])) { + $this->getResultAttr($result, $this->options['with_attr']); } } @@ -108,9 +115,9 @@ trait ResultOperation * @access protected * @param array $result 查询数据 * @param array $withAttr 字段获取器 - * @return array + * @return void */ - protected function getResultAttr(array $result, array $withAttr = []): array + protected function getResultAttr(array &$result, array $withAttr = []): void { foreach ($withAttr as $name => $closure) { $name = Str::snake($name); @@ -126,8 +133,6 @@ trait ResultOperation $result[$name] = $closure($result[$name] ?? null, $result); } } - - return $result; } /** @@ -161,30 +166,17 @@ trait ResultOperation /** * JSON字段数据转换 * @access protected - * @param array $result 查询数据 - * @param array $json JSON字段 - * @param bool $assoc 是否转换为数组 - * @param array $withRelationAttr 关联获取器 + * @param array $result 查询数据 * @return void */ - protected function jsonResult(array &$result, array $json = [], bool $assoc = false, array $withRelationAttr = []): void + protected function jsonResult(array &$result): void { - foreach ($json as $name) { + foreach ($this->options['json'] as $name) { if (!isset($result[$name])) { continue; } $result[$name] = json_decode($result[$name], true); - - if (isset($withRelationAttr[$name])) { - foreach ($withRelationAttr[$name] as $key => $closure) { - $result[$name][$key] = $closure($result[$name][$key] ?? null, $result[$name]); - } - } - - if (!$assoc) { - $result[$name] = (object) $result[$name]; - } } } diff --git a/vendor/topthink/think-orm/src/model/concern/Attribute.php b/vendor/topthink/think-orm/src/model/concern/Attribute.php index a48c74e..9201f90 100644 --- a/vendor/topthink/think-orm/src/model/concern/Attribute.php +++ b/vendor/topthink/think-orm/src/model/concern/Attribute.php @@ -106,12 +106,6 @@ trait Attribute */ private $withAttr = []; - /** - * 数据处理 - * @var array - */ - private $filter = []; - /** * 获取模型对象的主键 * @access public @@ -183,24 +177,6 @@ trait Attribute return $this; } - /** - * 设置模型数据处理 - * @access public - * @param callable $filter 数据处理Callable - * @param string $index 索引(唯一) - * @return $this - */ - public function filter(callable $filter, string $index = null) - { - if ($index) { - $this->filter[$index] = $filter; - } else { - $this->filter[] = $filter; - } - - return $this; - } - /** * 获取实际的字段名 * @access protected @@ -274,6 +250,17 @@ trait Attribute return $this; } + /** + * 刷新对象原始数据(为当前数据) + * @access public + * @return $this + */ + public function refreshOrigin() + { + $this->origin = $this->data; + return $this; + } + /** * 获取对象原始数据 如果不存在指定字段返回null * @access public @@ -555,6 +542,10 @@ trait Attribute */ protected function getJsonValue($name, $value) { + if (is_null($value)) { + return $value; + } + foreach ($this->withAttr[$name] as $key => $closure) { if ($this->jsonAssoc) { $value[$key] = $closure($value[$key], $value); diff --git a/vendor/topthink/think-orm/src/model/concern/RelationShip.php b/vendor/topthink/think-orm/src/model/concern/RelationShip.php index 33c1b89..8faadf4 100644 --- a/vendor/topthink/think-orm/src/model/concern/RelationShip.php +++ b/vendor/topthink/think-orm/src/model/concern/RelationShip.php @@ -291,14 +291,13 @@ trait RelationShip /** * 预载入关联查询 返回模型对象 * @access public - * @param Model $result 数据对象 * @param array $relations 关联 * @param array $withRelationAttr 关联获取器 * @param bool $join 是否为JOIN方式 * @param mixed $cache 关联缓存 * @return void */ - public function eagerlyResult(Model $result, array $relations, array $withRelationAttr = [], bool $join = false, $cache = false): void + public function eagerlyResult(array $relations, array $withRelationAttr = [], bool $join = false, $cache = false): void { foreach ($relations as $key => $relation) { $subRelation = []; @@ -333,7 +332,7 @@ trait RelationShip $relationCache = $cache[$relationName] ?? []; } - $relationResult->eagerlyResult($result, $relationName, $subRelation, $closure, $relationCache, $join); + $relationResult->eagerlyResult($this, $relationName, $subRelation, $closure, $relationCache, $join); } } diff --git a/view/taoler/index/article/ask/cate.html b/view/taoler/index/article/ask/cate.html index ed75801..fb5763f 100644 --- a/view/taoler/index/article/ask/cate.html +++ b/view/taoler/index/article/ask/cate.html @@ -11,9 +11,9 @@
    @@ -90,6 +90,7 @@ diff --git a/view/taoler/index/article/ask/detail.html b/view/taoler/index/article/ask/detail.html index a9e8e29..0d033cc 100644 --- a/view/taoler/index/article/ask/detail.html +++ b/view/taoler/index/article/ask/detail.html @@ -294,10 +294,9 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ //首次不执行 if(!first){ var page = obj.curr; - console.log(page); - var url = "{:url('article/detail',['id'=>$article.id])}"; + var url = "{:url('article/detail',['id'=>$article.id])}"; var id = "{$article.id}"; - $.post("{:url('article/detail')}",{"page":page,"id":id},function(){ + $.post("{:url('article/detail')}",{"id":id,"page":page},function(){ window.location.href = url + '?page=' + page + '#flyReply'; }); } diff --git a/view/taoler/index/article/cate.html b/view/taoler/index/article/cate.html index 5236d3d..2fbf430 100644 --- a/view/taoler/index/article/cate.html +++ b/view/taoler/index/article/cate.html @@ -100,15 +100,10 @@ ,curr : "{$artList['current_page']}" //获取起始页 ,jump: function(obj, first){ - //obj包含了当前分页的所有参数,比如: - console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。 - //console.log(obj.limit); //得到每页显示的条数 //首次不执行 if(!first){ - //do something - //window.location.href= url+obj.curr+'&limit='+obj.limit+'#collection'; //跳转 - //var page = obj.curr ? obj.curr : 1; - window.location.href = '{$url}'+ obj.curr +'.html'; //跳转 + + window.location.href = '{$path}/'+ obj.curr +'.html'; //跳转 } } }); diff --git a/view/taoler/index/article/posts/cate.html b/view/taoler/index/article/posts/cate.html index be10627..7a6e508 100644 --- a/view/taoler/index/article/posts/cate.html +++ b/view/taoler/index/article/posts/cate.html @@ -85,24 +85,19 @@ //执行一个laypage实例 laypage.render({ - elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号 - ,count: "{$artList['total']}" //数据总数,从服务端得到 - ,limit: "{$artList['per_page']}" - ,curr : "{$artList['current_page']}" - - //获取起始页 - ,jump: function(obj, first){ - //obj包含了当前分页的所有参数,比如: - //console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。 - //console.log(obj.limit); //得到每页显示的条数 - - //首次不执行 - if(!first){ - //do something - //window.location.href= url+obj.curr+'&limit='+obj.limit+'#collection'; //跳转 - window.location.href = '{$url}'+obj.curr+'.html'; //跳转 - } - } + elem: 'pages' //注意,这里的 test1 是 ID,不用加 # 号 + ,count: "{$artList['total']}" //数据总数,从服务端得到 + ,limit: "{$artList['per_page']}" + ,curr : "{$artList['current_page']}" + + //获取起始页 + ,jump: function(obj, first){ + + //首次不执行 + if(!first){ + window.location.href = '{$path}/'+obj.curr+'.html'; //跳转 + } + } }); }); diff --git a/view/taoler/index/article/posts/detail.html b/view/taoler/index/article/posts/detail.html index 59a8e03..e615790 100644 --- a/view/taoler/index/article/posts/detail.html +++ b/view/taoler/index/article/posts/detail.html @@ -271,8 +271,9 @@ layui.use(['fly', 'face','colorpicker','plyr', 'laypage'], function(){ //首次不执行 if(!first){ var page = obj.curr; - var url = "{:url('article/detail',['id'=>$article.id])}" - $.post(url,{"page":page},function(){ + var url = "{:url('article/detail',['id'=>$article.id])}"; + var id = "{$article.id}"; + $.post("{:url('article/detail')}",{"id":id,"page":page},function(){ window.location.href = url + '?page=' + page + '#flyReply'; }); } diff --git a/view/taoler/index/index/index.html b/view/taoler/index/index/index.html index b98727e..c55f5c7 100644 --- a/view/taoler/index/index/index.html +++ b/view/taoler/index/index/index.html @@ -35,7 +35,7 @@
diff --git a/view/taoler/index/public/base.html b/view/taoler/index/public/base.html index 740f5e6..f87d993 100644 --- a/view/taoler/index/public/base.html +++ b/view/taoler/index/public/base.html @@ -37,7 +37,7 @@ layui.cache.user = { username: "{$user.name??'游客'}" ,uid: "{$user.id ?? -1}" - ,avatar: "{$user['user_img'] ?? '/static/res/images/avatar/00.jpg'}" + ,avatar: '/static/res/images/avatar/00.jpg' ,experience: "{$user.point ?? ''}" ,sex: "{$user.sex ? '女':'男'}" }; diff --git a/view/taoler/index/public/filter.html b/view/taoler/index/public/filter.html index 2c16fca..53940e7 100644 --- a/view/taoler/index/public/filter.html +++ b/view/taoler/index/public/filter.html @@ -1,11 +1,11 @@