예제 #1
0
 /**
  * 更新用户信息到数据库
  *
  * @access private
  */
 private function updateUserInfo()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = (array) Request::input('data');
     $manager = new UserProcess();
     if (!$manager->editUser($manager->userSaveParams($data))) {
         return Js::error($manager->getErrorMessage());
     }
     $this->setActionLog();
     return Js::locate(!empty($httpReferer) ? $httpReferer : route('foundation.user.index'), 'parent');
 }
예제 #2
0
 /**
  * 更新用户信息到数据库
  *
  * @access private
  */
 private function updateUserInfoToDatabase()
 {
     $httpReferer = Session::getOldInput('http_referer');
     $data = Request::input('data');
     if (!$data or !is_array($data)) {
         return Js::error(Lang::get('common.info_incomplete'));
     }
     $param = new \App\Services\Admin\User\Param\UserSave();
     $param->setAttributes($data);
     $manager = new UserActionProcess();
     if ($manager->editUser($param)) {
         $this->setActionLog();
         $backUrl = !empty($httpReferer) ? $httpReferer : R('common', 'foundation.user.index');
         return Js::locate($backUrl, 'parent');
     }
     return Js::error($manager->getErrorMessage());
 }