diff --git a/app/api/model/Article.php b/app/api/model/Article.php index 5f14362f..52b89fab 100644 --- a/app/api/model/Article.php +++ b/app/api/model/Article.php @@ -141,4 +141,14 @@ class Article extends ArticleModel return $this->save(['is_delete' => 1]); } + /** + * 获取文章总数量 + * @param array $where + * @return int + */ + public static function getArticleTotal(array $where = []): int + { + return (new static)->where($where)->where('is_delete', '=', 0)->count(); + } + } \ No newline at end of file