帮助中心

pull/1/head
limu 10 months ago
parent 2905ca262d
commit 84527803b9
  1. 7
      app/api/controller/Article.php
  2. 11
      app/api/model/Article.php

@ -46,4 +46,11 @@ class Article extends Controller
$detail = ArticleModel::getDetail($articleId);
return $this->renderSuccess(compact('detail'));
}
public function helpCenter(): Json
{
$model = new ArticleModel;
$list = $model->helpCenter();
return $this->renderSuccess(compact('list'));
}
}

@ -94,4 +94,15 @@ class Article extends ArticleModel
->paginate($limit);
return static::preload($list, ['image', 'category']);
}
public function helpCenter()
{
$list = $this->withoutField(['content'])
->where('status', '=', 1)
->where('is_delete', '=', 0)
->order(['sort' => 'asc', 'create_time' => 'desc'])
->select()->toArray();
$data = static::preload($list, ['image', 'category']);
return $data;
}
}
Loading…
Cancel
Save