'文章不存在']); } // 累积阅读数 $model->setInc('actual_views', 1); return $model; } /** * 获取文章列表 * @param int $category_id * @param int $limit * @return \think\Paginator * @throws \think\exception\DbException */ public function getList($category_id = 0, $limit = 15) { $category_id > 0 && $this->where('category_id', '=', $category_id); return $this->field(['article_content'], true) ->with(['image', 'category']) ->where('article_status', '=', 1) ->where('is_delete', '=', 0) ->order(['article_sort' => 'asc', 'create_time' => 'desc']) ->paginate($limit, false, [ 'query' => \request()->request() ]); } }