TopicController.php 821 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Exam\TopicService;
  4. /**
  5. * 题目管理-控制器
  6. */
  7. class TopicController extends Backend
  8. {
  9. public function __construct()
  10. {
  11. parent::__construct();
  12. $this->service = TopicService::make();
  13. }
  14. public function index()
  15. {
  16. $pageSize = request()->get('limit', 10);
  17. $list = $this->service->customList(request()->all(), $pageSize);
  18. $message = array(
  19. "msg" => '操作成功',
  20. "code" => 0,
  21. "data" => isset($list['list']) ? $list['list'] : [],
  22. "count" => isset($list['total']) ? $list['total'] : 0,
  23. );
  24. return $message;
  25. }
  26. public function sort()
  27. {
  28. $param = request()->all();
  29. return $this->service->sort($param);
  30. }
  31. }