mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
完成评论
This commit is contained in:
@@ -6,6 +6,7 @@ namespace app\index\controller;
|
||||
|
||||
use app\model\Post as ModelPost;
|
||||
use think\facade\View;
|
||||
use think\model\Relation;
|
||||
use think\Request;
|
||||
|
||||
class Post extends Common
|
||||
@@ -51,7 +52,11 @@ class Post extends Common
|
||||
{
|
||||
//
|
||||
|
||||
$model_post = ModelPost::where('uid',$uid)->find();
|
||||
$model_post = ModelPost::with([
|
||||
'comments' => function (Relation $query) {
|
||||
$query->order('id asc');
|
||||
}
|
||||
])->where('uid', $uid)->find();
|
||||
|
||||
$model_post->hits = $model_post->hits + 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user