Practice.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\admin\controller\teacher;
  3. use app\common\controller\Backend;
  4. use app\common\model\Config as ConfigModel;
  5. /**
  6. * sim-练习集合管理
  7. *
  8. * @icon fa fa-circle-o
  9. */
  10. class Practice extends Backend
  11. {
  12. /**
  13. * Collection模型对象
  14. * @var \app\admin\model\teacher\Collection
  15. */
  16. protected $model = null;
  17. protected $whereExtend = null;
  18. public function _initialize()
  19. {
  20. parent::_initialize();
  21. $this->model = new \app\admin\model\teacher\Collection;
  22. $this->assignConfig('sim_sim_type', ConfigModel::getSimTypeList());
  23. $this->assignConfig('sim_question_setting_method', ConfigModel::getSimQuestionList());
  24. $this->assign('sim_sim_type', ConfigModel::getSimTypeList());
  25. $this->assign('sim_question_setting_method', ConfigModel::getSimQuestionList());
  26. $this->whereExtend['exam_collection_type'] = 1;
  27. }
  28. /**
  29. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  30. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  31. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  32. */
  33. public function persent()
  34. {
  35. return $this->view->fetch();
  36. }
  37. }