You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Group.php 982 B

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\admin\controller\user;
  3. use app\common\controller\Backend;
  4. /**
  5. * 会员组管理
  6. *
  7. * @icon fa fa-users
  8. */
  9. class Group extends Backend
  10. {
  11. /**
  12. * @var \app\admin\model\UserGroup
  13. */
  14. protected $model = null;
  15. public function _initialize()
  16. {
  17. parent::_initialize();
  18. $this->model = model('UserGroup');
  19. $this->view->assign("statusList", $this->model->getStatusList());
  20. }
  21. public function add()
  22. {
  23. $nodeList = \app\admin\model\UserRule::getTreeList();
  24. $this->assign("nodeList", $nodeList);
  25. return parent::add();
  26. }
  27. public function edit($ids = NULL)
  28. {
  29. $row = $this->model->get($ids);
  30. if (!$row)
  31. $this->error(__('No Results were found'));
  32. $rules = explode(',', $row['rules']);
  33. $nodeList = \app\admin\model\UserRule::getTreeList($rules);
  34. $this->assign("nodeList", $nodeList);
  35. return parent::edit($ids);
  36. }
  37. }