display($this); } function sys_list( ){ $list = new \Jms\Gui\ClGrid(); $list->sql_sort = 'OrderNum asc'; $list->sql_filter = function($search,&$cond){ //$cond['ID'] = array('not in',array(\Zndp\User\RoleEnum::SUPER_ADMINISTRATOR,\Zndp\User\RoleEnum::GENERAL_ADMINISTRATOR)); }; $list->row_filter = function(&$row)use($list){ $level_arr = array('总公司','工作站','服务部','种植基地'); $row['Level_text'] = $level_arr[$row['Level']]; $row['IsLocked_text'] = $row['IsLocked'] ? '禁用' : '启用'; $row['IsAllowAdmin_text'] = $row['IsAllowAdmin'] ? '有': '无'; $options = array('rule'=>array('pattern'=>'number')); $row['OrderNum'] = $list->renderXEditableInput('排序',$row,'OrderNum',$options); }; $list->display($this); } public function sys_del( ){ // 检查是否有该角色账号 $id = I('get.id'); $cond = array('RoleId'=>$id); $count = M('uc_user')->where($cond)->count(); if($count > 0){ json_fail('有'.$count.'个该角色账号正在使用,无法删除'); } $grid = new \Jiaruan\GridData(); $grid->deleteByPk($this); } }