mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
完成评论统计
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use think\facade\Cache;
|
||||
use think\Model;
|
||||
use think\model\concern\SoftDelete;
|
||||
use think\Paginator;
|
||||
@@ -39,6 +40,15 @@ class Post extends Model
|
||||
return $this->hasMany(PostComment::class,'post_id');
|
||||
}
|
||||
|
||||
|
||||
public function getCommentCountAttr()
|
||||
{
|
||||
|
||||
|
||||
|
||||
return PostComment::getPostCommentsCount($this->getData('id'));
|
||||
}
|
||||
|
||||
public function setPublishTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
|
||||
Reference in New Issue
Block a user