public function save($params) { $params['seller_type'] = '1'; if (!$params['role_id'] || $params['role_id'] == '0') { throw new \LogicException('请选择角色'); } return shopAuth::signupSeller($params, true); }
/** * @brief 创建商家会员 * * @return json */ public function create() { if (input::get('license') != 'on') { $msg = $this->app->_('同意注册条款后才能注册'); throw new \LogicException($msg); } try { shopAuth::signupSeller(input::get()); } catch (Exception $e) { $msg = $e->getMessage(); } if (pamAccount::check()) { $url = url::action('topshop_ctl_index@index'); $msg = app::get('topshop')->_('注册成功'); return $this->splash('success', $url, $msg, true); } else { return $this->splash('error', null, $msg, true); } }
public function createc() { $data = utils::_filter_input(input::get()); $a = $data['pam_user']; $codyKey = $data['key']; $verifycode = $data['verifycode']; $userInfo = $data['pam_user']; $vcode = $data['vcode']; $seller_type = $data["seller_type"]; if ($seller_type != "1" && $seller_type != "2" && $seller_type != "0") { return $this->splash('error', null, "请选择企业类型"); } try { // $accountType = kernel::single('pam_tools')->checkLoginNameType($userInfo['account']); // if($accountType == "mobile") // { // $vcodeData=userVcode::verify($vcode,$userInfo['account'],'signup'); // if(!$vcodeData) // { // throw new \LogicException(app::get('topc')->_('手机验证码错误')); // } // } // else // { // if( empty($verifycode) || !base_vcode::verify($codyKey,$verifycode) ) // { // throw new \LogicException(app::get('topc')->_('验证码填写错误')); // } // } $shopInfo = array("login_account" => $userInfo['account'], "login_password" => $userInfo['password'], "psw_confirm" => $userInfo['pwd_confirm'], "name" => $userInfo['con_name'], "mobile" => $userInfo["phone"], "email" => $userInfo["email"], "license" => "on"); $a = 1; shopAuth::signupSeller($shopInfo); $userId = userAuth::signUp($userInfo['account'], $userInfo['password'], $userInfo['pwd_confirm']); //shopAuth::signupSeller($shopInfo); userAuth::login($userId, $userInfo['account']); $sql = "UPDATE sysshop_seller set seller_type=" . $seller_type . " where seller_id in (select seller_id from sysshop_account where login_account = '" . $userInfo['account'] . "' )"; $result = app::get('sysshop')->database()->executeUpdate($sql); } catch (Exception $e) { $msg = $e->getMessage(); return $this->splash('error', $url, $msg, true); } $url = url::action('topc_ctl_passport@signupSuccess', ['next_page' => $this->__getFromUrl()]); return $this->splash('success', $url, null, true); }