Exam.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\admin\controller\student;
  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 Exam extends Backend
  11. {
  12. /**
  13. * Exams模型对象
  14. * @var \app\admin\model\teacher\Exams
  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\Exams;
  22. $groupIds = $this->auth->getGroupIds();
  23. //学员查看自己的
  24. if(in_array(8, $groupIds)){
  25. $this->whereExtend['user_id'] = $this->auth->id;
  26. }
  27. $this->assignconfig("groupIds", $groupIds[0]);
  28. }
  29. /**
  30. * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
  31. * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
  32. * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
  33. */
  34. }