DriverController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Http\Controllers\Admin;
  12. use App\Services\Common\DriverService;
  13. /**
  14. * 用户管理-控制器
  15. * @author laravel开发员
  16. * @since 2020/11/11
  17. * @package App\Http\Controllers
  18. */
  19. class DriverController extends Backend
  20. {
  21. /**
  22. * 构造函数
  23. * @author laravel开发员
  24. * @since 2020/11/11
  25. */
  26. public function __construct()
  27. {
  28. parent::__construct();
  29. $this->service = new DriverService();
  30. }
  31. public function index()
  32. {
  33. $pageSize = request()->get('limit', 10);
  34. $list = $this->service->getDataList(request()->all(), $pageSize);
  35. $message = array(
  36. "msg" => '操作成功',
  37. "code" => 0,
  38. "data" => isset($list['list']) ? $list['list'] : [],
  39. "count" => isset($list['total']) ? $list['total'] : 0,
  40. );
  41. return $message;
  42. }
  43. /**
  44. * 选项列表
  45. * @return mixed
  46. */
  47. public function options()
  48. {
  49. $result = $this->service->options();
  50. return message(1002, true, $result);
  51. }
  52. }