Exemplo n.º 1
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;
 }
Exemplo n.º 2
0
 private function getBlockName($type_id)
 {
     $result = Dao_Broker_BrokerInfo::get_comm($type_id);
     return $result['TYPENAME'];
 }