Practice.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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->whereExtend['exam_collection_type'] = 1;
  25. }
  26. /**
  27. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  28. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  29. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  30. */
  31. public function persent()
  32. {
  33. return $this->view->fetch();
  34. }
  35. }