/** * 编辑用户组入库处理 * * @access private */ private function updateDatasToDatabase() { $httpReferer = Session::getOldInput('http_referer'); $data = Request::input('data'); if (!$data or !is_array($data)) { return Js::error(Lang::get('common.illegal_operation')); } $params = new \App\Services\Admin\Group\Param\GroupSave(); $params->setAttributes($data); $manager = new GroupActionProcess(); if ($manager->editGroup($params)) { $this->setActionLog(); $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'foundation.group.index'); return Js::locate($backUrl, 'parent'); } return Js::error($manager->getErrorMessage()); }
/** * 删除用户组 * * @access public */ public function delete(GroupValidate $groupValidate, GroupModel $groupModel, GroupProcess $manager) { $id = $groupValidate->deleteIds((array) Request::input('id')); if (!$id or !is_array($id)) { return responseJson(Lang::get('common.action_error')); } $groupInfos = $groupModel->getGroupInIds($id); if (!$manager->detele($id)) { return responseJson($manager->getErrorMessage()); } $this->setActionLog(['groupInfos' => $groupInfos]); return responseJson(Lang::get('common.action_success'), true); }