/** * 获取贷款所有信息、全国风控提交之前的数据 */ 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; }
public function uploadAction($type, $uid) { //权限 static $types = ['car' => ['auth' => 'car', 'label' => '车辆照片'], 'loan' => ['auth' => 'apply', 'label' => '贷款资料'], 'face' => ['auth' => 'face', 'label' => '面审资料']]; $typeid = \App\Config\Loan::uploadTypes($type); if (!$typeid) { $this->pageError('param'); } $label = $types[$type]['label']; if ($this->request->getPost()) { $file = $this->upload($type)[0]; $result = $file['success']; unset($file['success']); if ($result) { $data = ['uid' => $uid, 'oid' => $this->getOperatorId(), 'type' => $typeid, 'label' => $label, 'path' => '/' . $file['filename'], 'is_img' => \Func\isImg($file['filename']) ? 1 : 0, 'info' => ' ']; if ((new Files())->add($data)) { $this->ajaxReturn($file); } else { $this->error('操作失败'); } } else { $this->ajaxReturn($file['errmsg'], 0); } exit; } $files = Files::getFilesByUid($uid, $typeid); $this->view->setVars(['label' => $label, 'uid' => $uid, 'type' => $type, 'files' => $files]); $this->view->pick('loan/upload'); }