SubjectController.php 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Exam\SubjectService;
  4. /**
  5. * 课程管理-控制器
  6. */
  7. class SubjectController extends Backend
  8. {
  9. public function __construct()
  10. {
  11. parent::__construct();
  12. $this->service = SubjectService::make();
  13. }
  14. // GET /admin/subjects
  15. public function index()
  16. {
  17. $pageSize = request()->get('limit', 10);
  18. $list = $this->service->customList(request()->all(), $pageSize);
  19. $message = array(
  20. "msg" => '操作成功',
  21. "code" => 0,
  22. "data" => isset($list['list']) ? $list['list'] : [],
  23. "count" => isset($list['total']) ? $list['total'] : 0,
  24. );
  25. return $message;
  26. }
  27. /**
  28. * 选项列表
  29. * @return mixed
  30. */
  31. public function options()
  32. {
  33. $result = $this->service->options();
  34. return message(1002, true, $result);
  35. }
  36. }