CourseController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\api\controller\auti;
  3. use app\models\course\OrganModel;
  4. use app\models\course\CourseModel;
  5. use app\Request;
  6. use crmeb\services\UtilService;
  7. class CourseController
  8. {
  9. public function organList(Request $request)
  10. {
  11. $where = UtilService::getMore([
  12. [['page', 'd'], 1],
  13. [['limit', 'd'], 15]
  14. ], $request);
  15. $list = OrganModel::systemPage($where);
  16. return app('json')->successful($list);
  17. }
  18. public function organ($id)
  19. {
  20. $info = OrganModel::where('is_del', 0)->find($id)->toArray();
  21. return app('json')->successful($info);
  22. }
  23. public function list(Request $request)
  24. {
  25. $where = UtilService::getMore([
  26. [['page', 'd'], 1],
  27. [['limit', 'd'], 15],
  28. ['area', '']
  29. ], $request);
  30. $list = CourseModel::systemPage($where);
  31. return app('json')->successful($list);
  32. }
  33. public function detail($id)
  34. {
  35. $info = CourseModel::where('is_del', 0)->find($id)->toArray();
  36. return app('json')->successful($info);
  37. }
  38. }