public function actionGsignup() { if ($_GET['code']) { $code = $_GET['code']; } if ($_POST) { $member = member::register($_POST['phone'], $_POST['password'], $_POST['password'], $_POST['code'], '4', $_POST['url_code']); if ($member['errorNum'] == 1) { return $this->goBack(['info' => $member['errorMsg']], Url::to(['gsignup'])); } else { return $this->redirect('site/member'); } } return $this->view('gsignup', compact('code')); }
/** * 用户注册登录 * @return array|string */ public function actionRegister() { $result = App::AppGet(); try { if ($result['errorNum']) { $result = array('errorNum' => $result['errorNum'], 'errorMsg' => $result['errorMsg'], 'data' => null); } else { $data = $result['data']; if (array_key_exists('phone', $data) && array_key_exists('pwd', $data) && array_key_exists('confirm_pwd', $data) && array_key_exists('phone_code', $data) && array_key_exists('invite_code', $data) && array_key_exists('from', $data)) { $phone = $data['phone']; $pwd = $data['pwd']; $confirm_pwd = $data['confirm_pwd']; $phone_code = $data['phone_code']; $from = $data['from']; $invite_code = $data['invite_code']; $result = member::register($phone, $pwd, $confirm_pwd, $phone_code, $from, $invite_code); } else { $result = array('errorNum' => '1', 'errorMsg' => '参数错误', 'data' => null); } } } catch (ErrorException $e) { Yii::error("用户注册登录---异常 方法:actionRegister 参数:" . json_encode($result['data']), "app"); Yii::trace($e->getMessage(), "app"); $result = array('errorNum' => '7', 'errorMsg' => '服务器异常,请联系管理员', 'data' => null); } $result = App::AppReturn($result); return $result; }