ArticleController.php 629 B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace app\api\controller\auti;
  3. use app\models\article\ArticleModel;
  4. use app\Request;
  5. use crmeb\services\UtilService;
  6. class ArticleController
  7. {
  8. public function list(Request $request)
  9. {
  10. $where = UtilService::getMore([
  11. [['page', 'd'], 1],
  12. [['limit', 'd'], 15],
  13. ['is_show', '']
  14. ], $request);
  15. $list = ArticleModel::systemPage($where);
  16. return app('json')->successful($list);
  17. }
  18. public function detail($id)
  19. {
  20. $info = ArticleModel::where('is_del', 0)->find($id)->toArray();
  21. return app('json')->successful($info);
  22. }
  23. }