ArticleController.php 1003 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Common\ArticleService;
  4. /**
  5. * 文章
  6. * Class ArticleController
  7. * @package App\Http\Controllers\Admin
  8. */
  9. class ArticleController extends Backend
  10. {
  11. public function __construct()
  12. {
  13. parent::__construct();
  14. $this->service = new ArticleService();
  15. }
  16. /**
  17. * 获取列表
  18. * @return array|mixed
  19. */
  20. public function index()
  21. {
  22. $pageSize = request()->post('limit', 15);
  23. $params = request()->all();
  24. $list = ArticleService::make()->getDataList($params, $pageSize);
  25. $message = array(
  26. "msg" => '操作成功',
  27. "code" => 0,
  28. "data" => isset($list['list'])? $list['list']:[],
  29. "count" => isset($list['total'])? $list['total']:0,
  30. );
  31. return $message;
  32. }
  33. /**
  34. * 发布广告
  35. * @return array|mixed
  36. */
  37. public function edit()
  38. {
  39. return ArticleService::make()->edit();
  40. }
  41. }