function getSSQ($s, $shi, $q) { $list1 = \common\models\Area::getInstance()->getTravelListById($s); $list2 = \common\models\Area::getInstance()->getTravelListById($shi); $list3 = \common\models\Area::getInstance()->getTravelListById($q); $str = ''; if (is_array($list1) && count($list1) > 0) { $str = $list1[0]['name']; if (is_array($list2) && count($list2) > 0) { $str .= '-' . $list2[0]['name']; if (is_array($list3) && count($list3) > 0) { $str .= '-' . $list3[0]['name']; } } } return $str; }
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(); }
/** * 获取去过的地方或者想去的地方的地区列表 */ public function actionGetTravelList() { $list = Area::getInstance()->getTravelListById($this->get['area_id']); $this->renderAjax(['status' => 1, 'data' => $list]); }