Exemplo n.º 1
0
 /**
  * 获取贷款所有信息、全国风控提交之前的数据
  */
 public static function infos($uid, $level = '*')
 {
     $uid = intval($uid);
     $infos = [];
     $infos['user'] = self::findFirst("uid={$uid}")->toArray();
     $isArray = is_array($level);
     $all = $level == '*';
     if ($all || ($isArray and in_array('loansketch', $level))) {
         $infos['loansketch'] = LoanSketch::findByUid($uid);
         $infos['loansketch_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'loansketch');
     }
     //面审
     if ($all || ($isArray and in_array('face', $level))) {
         $infos['face'] = Face::findByUid($uid);
         $infos['face_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'face');
     }
     //外访
     if ($all || ($isArray and in_array('visit', $level))) {
         $infos['visit'] = Visit::findByUid($uid);
         $infos['visit_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'visit');
     }
     //车评
     if ($all || ($isArray and in_array('car', $level))) {
         $infos['car'] = Car::findByUid($uid);
         $infos['car_advises'] = Advise::getAdvisesByUid($uid, Advise::STATUS_UNDO, 'car');
     }
     if ($all || ($isArray and in_array('car_files', $level))) {
         $infos['car_files'] = Files::getFilesByUid($uid, \App\Config\Loan::uploadTypes('car'));
     }
     //贷款
     if ($all || ($isArray and in_array('loan', $level))) {
         $infos['loan'] = Loan::findByUid($uid);
     }
     return $infos;
 }