/** * add method * * @return void */ public function admin_add() { if ($this->request->is('post')) { $this->User->create(); if ($this->User->save($this->request->data)) { $this->Session->setFlash(__('The user has been saved'), 'success'); $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The user could not be saved. Please, try again.'), 'error'); } } if (is_root_tenant() === true) { $this->User->Group->configIsolated('find', false); } $groups = $this->User->Group->getParents(); $this->set(compact('groups')); }
/** * 跟租户检测 */ protected function _setup_root() { if (is_root_tenant() && is_callable(array($this->{$this->modelClass}, 'configIsolated'))) { $this->{$this->modelClass}->configIsolated('find', false); } }