12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace app\admin\controller\csmadmin;
- use addons\csmadmin\library\CsmBackend;
- use addons\csmadmin\library\CsmUtils;
- /**
- * 角色组授权人员
- *
- * @icon fa fa-circle-o
- */
- class Group2admin extends CsmBackend
- {
-
- /**
- * Group2admin模型对象
- * @var \app\admin\model\csmadmin\Group2admin
- */
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\admin\model\csmadmin\Group2admin;
- }
- public function index()
- {
- // 当前页面必须从活动页面跳转过来
- $parentid = $this->csmreq("parentid", true);
- $parent = $this->csmGetDbRowByReqest(new \app\admin\model\AuthGroup(), "parentid");
- $this->assign('parent', $parent);
-
- // 设置过滤方法
- $this->request->filter([
- 'strip_tags'
- ]);
- if ($this->request->isAjax()) {
- // 如果发送的来源是Selectpage,则转发到Selectpage
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- list ($where, $sort, $order, $offset, $limit) = $this->buildparams();
- $total = $this->model->where($where)
- ->where("auth_group_id", "=", $parentid)
- ->order($sort, $order)
- ->count();
-
- $list = $this->model->where($where)
- ->where("auth_group_id", "=", $parentid)
- ->order($sort, $order)
- ->limit($offset, $limit)
- ->select();
-
-
- CsmUtils::convertListColumn($list, "auth_group_id", new \app\admin\model\AuthGroup(),'name');
- $dao = new \app\admin\model\Admin();
- CsmUtils::fillListColumn($list, "faadmin_id", $dao->where("status",'=','normal')->field("id,username,nickname,email"),'id');
-
- $list = collection($list)->toArray();
- $result = array(
- "total" => $total,
- "rows" => $list
- );
-
- return json($result);
- }
- return $this->view->fetch();
- }
- }
|