/** * 批量操作 * */ public function actionBatch() { if (XUtils::method() == 'GET') { $command = trim($_GET['command']); $ids = intval($_GET['id']); } elseif (XUtils::method() == 'POST') { $command = trim($_POST['command']); $ids = $this->_gets->getPost('id'); is_array($ids) && ($ids = implode(',', $ids)); } else { XUtils::message('errorBack', '只支持POST,GET数据'); } empty($ids) && XUtils::message('error', '未选择记录'); switch ($command) { case 'adminDelete': parent::_acl('admin_delete'); AdminLogger::_create(array('catalog' => 'delete', 'intro' => '删除管理员,ID:' . $ids)); parent::_delete(new Admin(), $ids, array('index')); break; case 'groupDelete': parent::_acl('admin_group_delete'); parent::_groupPrivate($ids); AdminLogger::_create(array('catalog' => 'delete', 'intro' => '删除管理员用户组,ID:' . $ids)); parent::_delete(new AdminGroup(), $ids, array('group')); break; default: throw new CHttpException(404, '错误的操作类型:' . $command); break; } }