コード例 #1
0
ファイル: Register.php プロジェクト: emilymwang8/ajk-broker
 public function handle_request_internal()
 {
     $mobile = $this->_params['mobile'];
     $password = $this->_params['password'];
     $checkPassword = $this->_params['checkPassword'];
     $truename = $this->_params['truename'];
     $cityId = $this->_params['cityId'];
     $mainBusiness = $this->_params['mainBusiness'];
     $companyId = $this->_params['companyId'];
     $storeId = $this->_params['storeId'];
     $blockId = $this->_params['blockId'];
     $ip = $this->_params['ip'];
     $is_rand_mobile = $this->_params['is_rand_mobile'];
     //验证数据
     $checkReturn = $this->checkData($password, $checkPassword, $cityId, $mainBusiness);
     if ($checkReturn !== true) {
         return $checkReturn;
     }
     //调试用的代码
     if ($is_rand_mobile == 1) {
         $mobile = substr(time(), 1, 7) . rand(1000, 9999);
     }
     #$areaInfo = Model_City_TypeCode::getAreaInfoByTypeId($blockId, $cityId);
     $areaInfo = Bll_Commtype_Api::getInfoByTypeIdAndCityId($blockId, $cityId);
     $post_data = array("j_password" => $password, "trueName" => $truename, "cityId" => $cityId, "areaCode" => $areaInfo['typeCode'], "companyId" => $companyId, "storeId" => $storeId, "userMobile" => $mobile, "channel" => 138, "regip" => $ip, "isPPC" => Bll_City::isFixCity($cityId) ? 'true' : 'false', "mainBussiness" => $mainBusiness);
     //打注册接口
     $res = $this->register($post_data);
     if ($res['status'] == 'ok') {
         //设置主营业务
         $mainBusinessId = $this->setMainBusiness($res['broker']['userId'], $res['broker']['brokerId'], $mainBusiness);
         if (!$mainBusinessId) {
             return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_SYS_ERR, 'message' => V1_RegisterController::MAIN_BUSINESS_FAIL);
         }
         //写主营业务log
         $mainBusinessLogId = $this->setMainBusinessLog($res['broker']['userId'], $res['broker']['brokerId'], $mainBusiness);
         if (!$mainBusinessLogId) {
             return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_SYS_ERR, 'message' => V1_RegisterController::MAIN_BUSINESS_LOG_FAIL);
         }
         //获取token
         $token = $this->createBrokerToken($res['broker']['brokerId'], $res['broker']['userName']);
         $sid = APF::get_instance()->get_config("sid", "login");
         //单点登录
         $registerBll = new Bll_Register();
         $registerBll->singleSignon($mobile, $password, $sid);
         return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('brokerId' => $res['broker']['brokerId'], 'userId' => $res['broker']['userId'], 'userName' => $res['broker']['userName'], 'cityId' => $res['broker']['cityId'], 'mobile' => $res['broker']['userMobile'], 'trueName' => $res['broker']['trueName'], 'token' => $token));
     } else {
         return array('status' => Const_APIStatus::RETURN_CODE_ERROR, 'errcode' => Const_APIStatus::E_JAVA_API_ERROR, 'message' => empty($res['info']) ? '请求超时' : $res['info']);
     }
 }
コード例 #2
0
 public function handle_request_internal()
 {
     $app = $this->_params['app'];
     $cv = $this->_params['cv'];
     $cityId = $this->_params['cityId'];
     // 基础业务类型 • 老端口
     $isDuankou = Bll_City::isDuankouCity($cityId);
     // 基础业务类型 • 定价
     $isFix = Bll_City::isFixCity($cityId);
     // 基础业务类型 • 新套餐
     $isCombo = Bll_City::isComboCity($cityId);
     // 增值业务类型 • 竞价
     $isBid = Bll_City::isBidCity($cityId);
     // 增值业务类型 • 精选
     $isChoice = Bll_City::isChoiceCity($cityId);
     if ($app == 'i-broker2' && $cv == 4.3) {
         if (!$isBid) {
             return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('isDuankou' => intval($isDuankou), 'isFix' => intval($isFix), 'isCombo' => intval($isCombo), 'isChoice' => intval($isChoice)));
         }
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('isDuankou' => intval($isDuankou), 'isFix' => intval($isFix), 'isCombo' => intval($isCombo), 'isBid' => intval($isBid), 'isChoice' => intval($isChoice)));
 }