public static function format($data) { static $repay_method = null; static $use_type = null; static $loan_type = null; static $status = null; !$repay_method and $repay_method = \App\Config\Loan::repayMethod(); !$use_type and $use_type = \App\Config\Loan::useType(); !$loan_type and $loan_type = \App\Config\Loan::loanType(); !$status and $status = \App\Config\Loan::status(); foreach ($data as &$row) { $row['repay_method_text'] = $repay_method[$row['repay_method']]; $row['use_type_text'] = $use_type[$row['use_type']]; $row['loan_type_text'] = $loan_type[$row['loan_type']]; $row['addtime'] = date('Y/m/d', $row['addtime']); $row['status_text'] = $status[$row['status']]; $row['amount'] = str_replace('.00', '', $row['amount']); $row['contract_text'] = $row['contract'] ? '已签' : ' - '; $row['gps_text'] = $row['gps'] ? '已安装' : ' - '; $row['car_key_text'] = $row['car_key'] ? '已拿' : ' - '; $row['pledge_notary_text'] = $row['pledge_notary'] ? '是' : ' - '; if ($row['begintime']) { $row['begintime'] = date('Y-m-d', $row['begintime']); } } return $data; }
public function adviseAction($uid) { $data = $this->request->getPost(); $adviseTypes = \App\Config\Loan::adviseTypes(); $adviseType = $data['advisetype']; $reason = $data['reason']; if (!array_key_exists($adviseType, $adviseTypes) || empty($reason)) { $this->error('参数错误'); } $foid = $this->getOperatorId(); if (Loan::advise($uid, $foid, $adviseType, $reason)) { $this->success('操作成功'); } $this->error('操作失败'); }
/** * 获取贷款所有信息、全国风控提交之前的数据 */ 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 static function fields() { return ['face' => ['oid' => null, 'loan_type' => ['label' => '贷款方式', 'type' => 'radio', 'default' => '1', 'options' => \App\Config\Loan::toOptions(\App\Config\Loan::loanType())], 'bigger' => ['label' => '是否放大', 'type' => 'checkbox', 'default' => 0, 'options' => [['value' => 1, 'text' => '是']]], 'debt_amount' => ['label' => '借款人及配偶负债', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'debt_prove' => ['label' => '证明方式', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'debt_month_repay' => ['label' => '每月还款金额', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'debt_info' => ['label' => '逾期情况说明', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'debt_car_info' => ['label' => '车辆情况说明', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'info_base' => ['label' => '基本情况说明', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'info_income' => ['label' => '借款人及配偶收入说明', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'use_info' => ['label' => '借款用途', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]], 'repay_source' => ['label' => '还款来源情况说明', 'type' => 'textarea', 'default' => '', 'inputOptions' => ['class' => 'col-lg-7'], 'validator' => ['required' => true]]], 'reface' => ['uid' => null, 'amount' => null, 'deadline' => null, 'apr' => null, 'repay_method' => null, 'reason' => null, 'risk' => null, 'notice' => null, 'remark' => null, 'guarantee' => null, 'uptime' => null]]; }
/** * 获取可以提反馈意见、修改的 */ private function adviseTypes($can_modify_actions = '*') { $adviseTypes = \App\Config\Loan::adviseTypes(['loansketch', 'visit', 'car']); if ($can_modify_actions === '*') { return $adviseTypes; } if ($can_modify_actions['reface']) { return $adviseTypes; } if ($can_modify_actions['face']) { unset($adviseTypes['visit'], $adviseTypes['car']); return $adviseTypes; } if ($can_modify_actions['apply'] || $can_modify_actions['visit'] || $can_modify_actions['car']) { return null; } }
static function getStatusText($_status) { static $status = null; !$status and $status = \App\Config\Loan::status(); return \Func\getArrayValue($status, $_status); }