public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $num = rand(1, 9);
     $params = array(array('brokerId' => '1357262', 'email' => '123owentansh@hotmail.com', 'mobile' => '1348569758' . $num, 'trueName' => '谭晓轶', 'gender' => 1));
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->setBasicInfo($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     //数据库验证
     $PDO = APF_DB_Factory::get_instance()->get_pdo('anjuke_slave');
     $sql = 'select UserMobile, TrueName,UserSex,UserId from ajk_brokerextend where brokerId = ?';
     $stmt = $PDO->prepare($sql);
     $stmt->execute(array($params[0]['brokerId']));
     $results = $stmt->fetch();
     $sql1 = 'select UserEmail, UserId from ajk_members where UserId = ?';
     $stmt1 = $PDO->prepare($sql1);
     $stmt1->execute(array($results['UserId']));
     $resu = $stmt1->fetch();
     $dbtest = $results['UserMobile'] == $params[0]['mobile'] && $resu['UserEmail'] == $params[0]['email'] && $results['TrueName'] == $params[0]['trueName'] && intval($results['UserSex']) == $params[0]['gender'] ? true : false;
     //var_dump($results);
     //var_dump($resu); //UserEmail 不对
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
     $this->phpUnitMsg('dbtest', $dbtest);
 }
Beispiel #2
0
 public function checkMobileExists($mobile)
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array($mobile);
     $rs = $BrokerServiceObj->checkMobileExists($params);
     $replies = $BrokerServiceObj->aps_wait_for_replies($rs);
     return $replies[$rs];
 }
Beispiel #3
0
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('brokerId' => 208649, 'cityId' => 10, 'areaCode' => '000100030029', 'mobile' => '1234567', 'phone' => '723178', 'fileName' => '5/e/1/4e1a5be4d9b12b8c9e82486d5c7e6db4.jpg', 'companyId' => 11, 'storeId' => 3061));
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->setBizCard($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('brokerId' => '1357262', 'state' => 1, 'adminId' => 1, 'dataId' => '1378580'));
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->verifyBizCard($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('brokerId' => '208649'));
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->getBasicInfo($params, 100);
     //aps_start_request
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array('123,124,125');
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->getIdentityInfos($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('mobile' => '123456'));
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->checkMobileExists($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
Beispiel #8
0
 public function handle_request_internal()
 {
     $request = APF::get_instance()->get_request();
     $brokerId = $request->getBrokerId();
     $userId = $request->getUserId();
     $params = $request->get_parameters();
     $BrokerServiceObj = new Bll_Service_Broker();
     $sq1 = $BrokerServiceObj->getBasicInfo(array('brokerId' => $brokerId));
     $replies1 = $BrokerServiceObj->aps_wait_for_replies();
     if (empty($replies1)) {
         apf_require_class("Uri_Http");
         Uri_Http::redirect_header('/user/broker/new/brokeremail?type=modify');
     }
     $oldEmail = $replies1[$sq1]['data']['email'];
     $flag = 0;
     if ($request->is_post_method()) {
         $password = Bll_Broker_User::getPasswordByUserId($userId);
         if (base64_encode(md5($params['password'])) == $password) {
             $userIdByEmail = Bll_Broker_User::getUserIdByEmail($params['email']);
             if (empty($userIdByEmail)) {
                 try {
                     //可以更改邮箱
                     $apsParams = array('brokerId' => $brokerId, 'email' => trim($params['email']));
                     $sq2 = $BrokerServiceObj->setBasicInfo($apsParams);
                     $replies2 = $BrokerServiceObj->aps_wait_for_replies();
                     $flag = $replies2[$sq2]['status'] == 'ok' ? Broker_EditEmailController::EDIT_SUCCESS : Broker_EditEmailController::EDIT_ERROR;
                 } catch (Exception $e) {
                     $flag = Broker_EditEmailController::EDIT_ERROR;
                 }
             } else {
                 //邮箱已经存在
                 //$flag = $userIdByEmail == $userId ? Broker_EditEmailController::EDIT_ERROR : Broker_EditEmailController::EMAIL_IS_EXIST;
                 $flag = Broker_EditEmailController::EMAIL_IS_EXIST;
             }
         } else {
             if (empty($params['password'])) {
                 $flag = Broker_EditEmailController::PASSWORD_EMPTY;
             } else {
                 $flag = Broker_EditEmailController::PASSWORD_ERROR;
             }
         }
         $request->set_attribute("newEmail", $params['email']);
         $request->set_attribute("url", $this->getURL('my', '/ajkbroker/broker/brokerinfo'));
     }
     $request->set_attribute("flag", $flag);
     $request->set_attribute("oldEmail", $oldEmail);
     return "Broker_EditEmail";
 }
Beispiel #9
0
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $num = rand(1, 10);
     $params = array(array('brokerId' => '1357262', 'photoUrl' => "e/{$num}/f/e6f8cee02e30aaaf2807bb1c856d0f5f.jpg"));
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->setNewPhoto($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
Beispiel #10
0
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('brokerId' => 16, 'state' => 2));
     //传入的参数
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->verifyIdCard($params, 100);
     //调用的接口
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     $PDO = APF_DB_Factory::get_instance()->get_pdo('anjuke_slave');
     $sql = 'select * from ajk_brokerextend where brokerId = ?';
     $stmt = $PDO->prepare($sql);
     $stmt->execute(array($params[0]['brokerId']));
     $results = $stmt->fetch();
     var_dump($results['UserCard']);
     $dbtest = $results['UserCard'] == $results['UserCardFile'] && $results['UsrCardState'] == 2 ? true : false;
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
     $this->phpUnitMsg('dbtest', $dbtest);
 }
Beispiel #11
0
 public function handle_request()
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('brokerId' => '1357262', 'logFlag' => '0', 'ip' => '1.2.3.4.999', 'guid' => 'asodfihasdoif-123123', 'loginFrom' => 1));
     echo PHP_EOL . '入参:' . PHP_EOL;
     print_r($params);
     $sq = $BrokerServiceObj->login($params, 100);
     //aps_start_request
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     echo '出参:' . PHP_EOL;
     print_r($reply[$sq]);
     //数据库验证
     $PDO = APF_DB_Factory::get_instance()->get_pdo('anjuke_slave');
     $sql = 'select UserMobile, TrueName,UserSex,UserId from ajk_brokerextend where brokerId = ?';
     $stmt = $PDO->prepare($sql);
     $stmt->execute(array($params[0]['brokerId']));
     $results = $stmt->fetch();
     $sql1 = 'select UserEmail, UserId from ajk_members where UserId = ?';
     $stmt1 = $PDO->prepare($sql1);
     $stmt1->execute(array($results['UserId']));
     $resu = $stmt1->fetch();
     //断言返回参数有18个
     $this->phpUnitMsg('reply', $reply[$sq]);
 }
Beispiel #12
0
 public function handle_request()
 {
     /*$IP = 'tcp://10.10.3.98:8965';
     
             $BrokerServiceObj = new Bll_Service_Broker($IP);
     
             $sq = $BrokerServiceObj->ping(); //aps_start_request
             $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     
             print_r($reply);
             echo '<br>-----------------------------<br>';*/
     $BrokerServiceObj = new Bll_Service_Broker();
     $sq1 = $BrokerServiceObj->ping();
     $sq2 = $BrokerServiceObj->status();
     $replies = $BrokerServiceObj->aps_wait_for_replies();
     echo '<pre>';
     print_r($replies);
     exit;
     echo '<br><br>';
     $params = array(array('brokerId' => '208649'));
     $response = $BrokerServiceObj->getBasicInfo($params);
     print_r($response);
     echo '<br><br>';
     $params = array(array('brokerId' => '208649'));
     $response = $BrokerServiceObj->getIdentityInfo($params);
     print_r($response);
     /*echo '<br><br>';
       $params = array(array('208649'));
       $response = $BrokerServiceObj->getBasicInfos($params);
       print_r($response);*/
     /*
             $client = APF_APS_Factory12::get_instance()->get_client('broker_production');
             $client->start_request('.status');
             $replies = APF_APS_Client12::wait_for_replies();
             print_r($replies);*/
 }
 public function setBrokerMobile($intBrokerId, $newMobile)
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array(array('brokerId' => $intBrokerId, 'mobile' => $newMobile));
     $sq = $BrokerServiceObj->setBasicInfo($params, 200);
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     if ($reply[$sq]['status'] == 'ok') {
         return $reply[$sq]['data'];
     }
 }
 public function verifyIdCard($brokerId, $trueName, $userCardFile, $idCardNo, $state, $adminId)
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params1 = array(array('brokerId' => $brokerId, 'trueName' => $trueName, 'userCardFile' => $userCardFile, 'idCardNo' => $idCardNo));
     $sq1 = $BrokerServiceObj->setNewIdCard($params1, 200);
     $params2 = array(array('brokerId' => $brokerId, 'state' => $state, 'adminId' => $adminId));
     $sq2 = $BrokerServiceObj->verifyIdCard($params2, 200);
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq1, $sq2));
     return $reply;
 }
 public static function checkMobileExists($mobile)
 {
     $BrokerServiceObj = new Bll_Service_Broker();
     $params = array($mobile);
     $sq = $BrokerServiceObj->checkMobileExists($params, 200);
     $reply = $BrokerServiceObj->aps_wait_for_replies(array($sq));
     if ($reply[$sq]['status'] == 'ok') {
         return $reply[$sq]['data'];
     } else {
         return array();
     }
 }