Пример #1
0
 public static function communitySignTopSigner($communityId, $currentSignRange, $per = 3)
 {
     $signs = Model_Broker_CommunitySign::data_access(date('Ym', strtotime($currentSignRange[0])))->filter('communityId', $communityId)->filter_by_op_multi(array(array('signTime', '>=', $currentSignRange[0]), array('signTime', '<=', $currentSignRange[1])))->sort('signTime', 'asc')->limit(3)->find_all();
     $signers = array();
     if ($signs) {
         $brokerIds = array();
         foreach ($signs as $sign) {
             $brokerIds[] = $sign['brokerId'];
         }
         $brokers = Model_Broker_AjkBrokerExtend::data_access()->filter('brokerId', $brokerIds)->find_all();
         $indexedBrokers = array();
         foreach ($brokers as $broker) {
             $indexedBrokers[$broker['brokerId']] = $broker;
         }
         foreach ($signs as $sign) {
             if (!isset($indexedBrokers[$sign['brokerId']])) {
                 continue;
             }
             $broker = $indexedBrokers[$sign['brokerId']];
             $signer = array();
             $signer['brokerId'] = $broker['brokerId'];
             $signer['brokerTrueName'] = $broker['trueName'];
             // 图片地址替换
             if ($broker['userPhoto']) {
                 $signer['brokerPhoto'] = Util_DisplayImages::get_img_url($broker['userPhoto'], -1, '100x133');
             } else {
                 $signer['brokerPhoto'] = PageHelper::pure_static_url('/img/bknoimg.gif');
                 // 默认头像
             }
             $signers[] = $signer;
         }
     }
     return $signers;
 }
Пример #2
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     //身份证
     $usrCardState = $brokerInfo->usrCardState;
     $userCardStatus = 0;
     if ($usrCardState == 2) {
         $userCardStatus = 1;
         //已认证
     }
     //头像
     $userPhoto = $brokerInfo->userPhoto;
     $usrPhotoState = $brokerInfo->usrPhotoState;
     $usrPhotoTmpState = $brokerInfo->usrPhotoTmpState;
     $photoStaus = 0;
     $imageUrl = '';
     if ($usrPhotoState == 2 || $usrPhotoTmpState == 1) {
         $photoStaus = 1;
         //已认证
         $imageUrl = Util_DisplayImages::get_img_url($userPhoto, -1, '100x133');
     }
     if ($photoStaus == 1 && $userCardStatus == 1) {
         $status = 1;
         //双证通过
     } else {
         $status = 0;
         //双证未通过审核
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => $status, 'userPhotoPassUrl' => $imageUrl));
 }
Пример #3
0
 /**
  * 获取用户头像的 URL
  *
  * @return string
  */
 public function getUserPhotoUrl()
 {
     $url = '';
     if ($this->userPhoto) {
         $url = Util_DisplayImages::get_img_url($this->userPhoto, -1, '150x150c');
     }
     return $url;
 }
Пример #4
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $usrPhotoState = $brokerInfo->usrPhotoState;
     $usrPhotoTmpState = $brokerInfo->usrPhotoTmpState;
     $userPhotoTmp = $brokerInfo->userPhotoTmp;
     $userPhoto = $brokerInfo->userPhoto;
     $photoStaus = 0;
     $smallImageUrl = '';
     $bigImageUrl = '';
     $failedReason = '';
     if ($usrPhotoState == 2 || $usrPhotoTmpState == 1) {
         $photoStaus = 1;
         //已认证
         $smallImageUrl = Util_DisplayImages::get_img_url($userPhoto, -1, '600x798');
         $bigImageUrl = Util_DisplayImages::get_img_url($userPhoto, -1, '1200x1596');
     } elseif ($usrPhotoState == 0 && empty($userPhoto) && empty($userPhotoTmp)) {
         $photoStaus = 0;
         //未认证
         $smallImageUrl = '';
         $bigImageUrl = '';
     } elseif ($usrPhotoState == 1 || $usrPhotoTmpState == 0 && !empty($userPhotoTmp)) {
         $photoStaus = 2;
         //认证中
         $smallImageUrl = $usrPhotoState == 1 ? Util_DisplayImages::get_img_url($userPhoto, -1, '600x798') : Util_DisplayImages::get_img_url($userPhotoTmp, -1, '600x798');
         $bigImageUrl = $usrPhotoState == 1 ? Util_DisplayImages::get_img_url($userPhoto, -1, '1200x1596') : Util_DisplayImages::get_img_url($userPhotoTmp, -1, '1200x1596');
     } elseif ($usrPhotoState == 3 || $usrPhotoTmpState == 2) {
         $photoStaus = 3;
         //认证失败
         $smallImageUrl = $usrPhotoTmpState == 2 ? Util_DisplayImages::get_img_url($userPhotoTmp, -1, '600x798') : Util_DisplayImages::get_img_url($userPhoto, -1, '600x798');
         $bigImageUrl = $usrPhotoTmpState == 2 ? Util_DisplayImages::get_img_url($userPhotoTmp, -1, '1200x1596') : Util_DisplayImages::get_img_url($userPhoto, -1, '1200x1596');
         $brokerCheckInfoBll = new Bll_Broker_BrokerCheckInfo();
         if ($usrPhotoState == 2) {
             $brokerTheLastCheck = $brokerCheckInfoBll->getBrokerTheLastCheckInfo($brokerId, 1);
             $failedReason = $brokerTheLastCheck['content'];
         } else {
             $failedReason = $brokerCheckInfoBll->getNoPassExp($brokerId, 1);
             //1图像
         }
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => $photoStaus, 'bigImageUrl' => $bigImageUrl, 'smallImageUrl' => $smallImageUrl, 'failedReason' => $failedReason));
 }
Пример #5
0
 public function handle_request_internal()
 {
     $brokerIds = explode(',', $this->_params['brokerIds']);
     $brokerInfos = Model_Broker_AjkBrokerExtend::findMultiBrokers($brokerIds);
     $brokerBaseInfo = array();
     foreach ($brokerInfos as $brokerInfo) {
         $row = array();
         $row['brokerId'] = $brokerInfo['brokerId'];
         $row['userMobile'] = $brokerInfo['userMobile'];
         $row['trueName'] = $brokerInfo['trueName'];
         $row['cityId'] = $brokerInfo['cityId'];
         $row['userPhotoUrl'] = Util_DisplayImages::get_img_url($brokerInfo['userPhoto'], -1, '100x133');
         $row['userDescription'] = '';
         $brokerBaseInfo[] = $row;
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => $brokerBaseInfo);
 }
Пример #6
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     $usrCardState = $brokerInfo->usrCardState;
     $userCardFile = $brokerInfo->userCardFile;
     $userCard = $brokerInfo->userCard;
     $userCardStatus = 0;
     $bigImageUrl = '';
     $smallImageUrl = '';
     $failedReason = '';
     if ($usrCardState == 0 && empty($userCardFile)) {
         $userCardStatus = 0;
         //未认证
         $bigImageUrl = '';
         $smallImageUrl = '';
     } elseif ($usrCardState == 1) {
         $userCardStatus = 2;
         //认证中
         $bigImageUrl = Util_DisplayImages::get_img_url($userCardFile, -1, '1200x750');
         $smallImageUrl = Util_DisplayImages::get_img_url($userCardFile, -1, '1000x625');
     } elseif ($usrCardState == 2) {
         $userCardStatus = 1;
         //已认证
         $bigImageUrl = Util_DisplayImages::get_img_url($userCardFile, -1, '1200x750');
         $smallImageUrl = Util_DisplayImages::get_img_url($userCardFile, -1, '1000x625');
     } elseif ($usrCardState == 3) {
         $userCardStatus = 3;
         //认证失败
         $bigImageUrl = Util_DisplayImages::get_img_url($userCardFile, -1, '1200x750');
         $smallImageUrl = Util_DisplayImages::get_img_url($userCardFile, -1, '1000x625');
         $brokerCheckInfoBll = new Bll_Broker_BrokerCheckInfo();
         $failedReason = $brokerCheckInfoBll->getNoPassExp($brokerId, 2);
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => $userCardStatus, 'userCard' => $userCard, 'bigImageUrl' => $bigImageUrl, 'smallImageUrl' => $smallImageUrl, 'failedReason' => $failedReason));
 }
Пример #7
0
 /**
  * app 获取经纪人基础信息
  */
 public static function get_broker_baseinfo_app($broker_id)
 {
     $base_info = Dao_Broker_BrokerInfo::get_broker_base_info($broker_id);
     if (empty($base_info)) {
         return array();
     }
     //头像状态
     $usrPhotoState = $base_info['USRPHOTOSTATE'];
     $usrPhotoTmpState = $base_info['USRPHOTOTMPSTATE'];
     $userPhotoTmp = $base_info['USERPHOTOTMP'];
     $userPhoto = $base_info['USERPHOTO'];
     $imageUrl = '';
     $photoStaus = 0;
     if ($usrPhotoState == 2 || $usrPhotoTmpState == 1) {
         $photoStaus = 1;
         //已认证
         $imageUrl = Util_DisplayImages::get_img_url($userPhoto, -1, '100x133');
     } elseif ($usrPhotoState == 0 && empty($userPhoto) && empty($userPhotoTmp)) {
         $photoStaus = 0;
         //未认证
     } elseif ($usrPhotoState == 1 || $usrPhotoTmpState == 0 && !empty($userPhotoTmp)) {
         $photoStaus = 2;
         //认证中
     } elseif ($usrPhotoState == 3 || $usrPhotoTmpState == 2) {
         $photoStaus = 3;
         //认证失败
     }
     //身份证状态
     $usrCardState = $base_info['USRCARDSTATE'];
     $userCardFile = $base_info['USERCARDFILE'];
     $userCardStatus = 0;
     if ($usrCardState == 0 && empty($userCardFile)) {
         $userCardStatus = 0;
         //未认证
     } elseif ($usrCardState == 1) {
         $userCardStatus = 2;
         //认证中
     } elseif ($usrCardState == 2) {
         $userCardStatus = 1;
         //已认证
     } elseif ($usrCardState == 3) {
         $userCardStatus = 3;
         //认证失败
     }
     //名片状态
     $bnsCardState = $base_info['BNSCARDSTATE'];
     $bnsCardStatus = 0;
     $lastupdata = Bll_BrokerBaseBll::get_instance()->getLastPostBnsCardFile($broker_id);
     $isPass = $lastupdata['IsPass'];
     if (empty($lastupdata)) {
         //没认证
         $bnsCardStatus = 0;
     } else {
         if ($base_info['CHECKSTATE'] == 0) {
             switch ($bnsCardState) {
                 case 1:
                     //认证中 $bnsCardFile
                     $bnsCardStatus = 2;
                     break;
                 case 2:
                     //已认证 $bnsCardFile
                     $bnsCardStatus = 1;
                     break;
                 case 3:
                     //认证失败 $bnsCardFile
                     $bnsCardStatus = 3;
                     break;
             }
         } elseif ($base_info['CHECKSTATE'] == 1) {
             if ($isPass == 0) {
                 //认证中 FileName
                 $bnsCardStatus = 2;
             } elseif ($isPass == 1) {
                 //已认证 FileNam
                 $bnsCardStatus = 1;
             } elseif ($isPass == 2) {
                 //认证失败 FileName
                 $bnsCardStatus = 3;
             }
         }
     }
     //城市
     $citys = array();
     $citys_tmp = Dao_Broker_BrokerInfo::get_citys();
     foreach ($citys_tmp as $city) {
         $citys[$city['CITYID']] = $city['TYPENAME'];
     }
     //门店
     if ($base_info['CST_BROKER_COMPANY_ID'] != 0) {
         $cst_commpany = Dao_Broker_BrokerInfo::get_cst_company($base_info['CST_BROKER_COMPANY_ID']);
     } else {
         $cst_commpany['COMANYNAME'] = "";
     }
     //区域板块
     $area = Dao_Broker_BrokerInfo::get_comm(substr($base_info['AREACODE'], 4, 4));
     $block = Dao_Broker_BrokerInfo::get_comm(substr($base_info['AREACODE'], 8, 4));
     $return['brokerName'] = $base_info['TRUENAME'];
     $return['phone'] = $base_info['USERMOBILE'];
     $return['city_id'] = $base_info['CITYID'];
     $return['cityName'] = $citys[$base_info['CITYID']];
     // 城市名
     $return['workRegion'] = $area['TYPENAME'] . ' ' . $block['TYPENAME'];
     //工作区域
     //获取所属公司
     $com = Model_Broker_CstCompany::getCompanyNameById($base_info['COMPANYID']);
     $return['company'] = $com['CompanyName'];
     //所属公司
     $return['store'] = $cst_commpany['COMANYNAME'];
     //所属门店
     $return['display'] = "";
     $return['bnsCardStatus'] = $bnsCardStatus;
     $return['userCardStatus'] = $userCardStatus;
     $return['userPhotoStatus'] = $photoStaus;
     $return['imageUrl'] = $imageUrl;
     $return['userId'] = $base_info['USERID'];
     //账户余额
     $hzbroker_id = Bll_HzBroker::get_brokerid_by_ajk_brokerid($broker_id);
     if (!$hzbroker_id) {
         $hzbroker_id = $broker_id;
     }
     $broker_money = Bll_PayAccount::get_broker_balance($hzbroker_id);
     $return['balance'] = sprintf("%.2f", $broker_money);
     return $return;
 }
Пример #8
0
 public function handle_request_internal()
 {
     $brokerId = $this->_params['brokerId'];
     $brokerInfo = Model_Broker_AjkBrokerExtend::findWithBrokerId($brokerId);
     if (!$brokerInfo) {
         throw new Exception_BrokerNotFoundException('经纪人不存在', Const_APIStatus::E_BROKER_NOT_EXISTS);
     }
     //        echo "<pre>";print_r($brokerInfo);exit;
     //
     //        $bnsCardFile = 'b';
     //        $setBizCard = Bll_BrokerBaseBll::setBizCard($brokerId, $brokerInfo->cityId, $brokerInfo->areaCode, $brokerInfo->userMobile,
     //            '', $bnsCardFile, $brokerInfo->companyId, $brokerInfo->cstBrokerCompanyId);
     //
     //        $res = $this->verifyBizCard($brokerId, 1, '123');
     $bnsCardState = $brokerInfo->bnsCardState;
     $bnsCardFile = $brokerInfo->bnsCardFile;
     $bnsCardStatus = 0;
     $bigImageUrl = '';
     $smallImageUrl = '';
     $failedReason = '';
     //获得最后提交资料
     $lastupdata = Bll_BrokerBaseBll::get_instance()->getLastPostBnsCardFile($brokerId);
     //使用model
     $isPass = $lastupdata['IsPass'];
     $FileName = $lastupdata['FileName'];
     if (empty($lastupdata)) {
         //没认证
         $bnsCardStatus = 0;
         $bigImageUrl = '';
         $smallImageUrl = '';
     } else {
         if ($brokerInfo->checkState == 0) {
             switch ($bnsCardState) {
                 case 1:
                     //认证中 $bnsCardFile
                     $bnsCardStatus = 2;
                     break;
                 case 2:
                     //已认证 $bnsCardFile
                     $bnsCardStatus = 1;
                     break;
                 case 3:
                     //认证失败 $bnsCardFile
                     $bnsCardStatus = 3;
                     break;
             }
             $bigImageUrl = Util_DisplayImages::get_img_url($bnsCardFile, -1, '1200x750');
             $smallImageUrl = Util_DisplayImages::get_img_url($bnsCardFile, -1, '1000x625');
         } elseif ($brokerInfo->checkState == 1) {
             if ($isPass == 0) {
                 //认证中 FileName
                 $bnsCardStatus = 2;
             } elseif ($isPass == 1) {
                 //已认证 FileNam
                 $bnsCardStatus = 1;
             } elseif ($isPass == 2) {
                 //认证失败 FileName
                 $bnsCardStatus = 3;
                 $brokerCheckInfoBll = new Bll_Broker_BrokerCheckInfo();
                 $brokerTheLastCheckInfo = $brokerCheckInfoBll->getBrokerTheLastCheckInfo($brokerId, 2);
                 $failedReason = $brokerTheLastCheckInfo['content'];
             }
             $bigImageUrl = Util_DisplayImages::get_img_url($FileName, -1, '1200x750');
             $smallImageUrl = Util_DisplayImages::get_img_url($FileName, -1, '1000x625');
         }
     }
     return array('status' => Const_APIStatus::RETURN_CODE_OK, 'data' => array('status' => $bnsCardStatus, 'bigImageUrl' => $bigImageUrl, 'smallImageUrl' => $smallImageUrl, 'failedReason' => $failedReason));
 }