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 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]]; }