コード例 #1
0
ファイル: MemberController.php プロジェクト: xswolf/baihey
 public function actionEdit()
 {
     $request = \Yii::$app->request;
     $id = $request->get('id');
     if ($id < 1) {
         exit;
     }
     if ($postData = $request->post()) {
         $postData['info']['mate'] = trim($postData['info']['mate']);
         $postData['info']['mate'] = str_replace("\t", "", $postData['info']['mate']);
         $postData['user_id'] = $id;
         $postData['info']['age'] = strtotime($postData['info']['age']);
         $user = User::getInstance()->editUser($postData);
         if ($user['id'] > 0) {
             return $this->__success('修改成功');
         } else {
             return $this->__error('修改失败');
         }
     }
     $user = User::getInstance()->getUserById($id);
     $user['info'] = json_decode($user['info']);
     $user['auth'] = json_decode($user['auth']);
     $this->assign('id', $id);
     $this->assign('user', $user);
     $this->assign('sport', Config::getInstance()->getListByType(1));
     $this->assign('movie', Config::getInstance()->getListByType(2));
     $this->assign('food', Config::getInstance()->getListByType(3));
     $this->assign('travel', Area::getInstance()->getWentTravelList());
     $photoList = UserPhoto::getInstance()->getPhotoList($id, 0, 12);
     $photoList = json_encode($photoList);
     $this->assign('photoList', $photoList);
     return $this->render();
 }
コード例 #2
0
ファイル: MemberController.php プロジェクト: xswolf/baihey
 /**
  * 获取去过的地方或者想去的地方的地区列表
  */
 public function actionGetConfigList()
 {
     $list = Config::getInstance()->getListById($this->get['config_id']);
     $this->renderAjax(['status' => 1, 'data' => $list]);
 }