public function remitAction() { if ($this->isAjax()) { $data = $this->request->getPost(); $uid = $data['uid']; !$uid and $this->error('参数错误'); $model = new LoanForm('remit'); if ($result = $model->validate($data)) { if ($model->remit()) { Log::add($uid, $this->getOperatorId(), \App\Config\Log::loanOperate('remit_certify')); $this->success('操作成功'); } else { $this->error('操作失败'); } } else { $this->error('验证失败'); } exit; } }
/** * 处理案件 */ public function dealAction() { if ($this->isAjax()) { $data = $this->request->getPost(); $type = $data['type']; if (!in_array($type, ['agree', 'refuse'])) { $this->error('参数错误'); } $data['oid'] = $this->getOperatorId(); $data['status'] = $type == 'agree' ? \App\LoanStatus::getStatusRcAgree() : \App\LoanStatus::getStatusRcRefuse(); $model = new LoanForm($type); $result = $model->validate($data); if ($result) { if ($model->deal()) { LoanSketch::updateStatus($data['uid'], $data['status']); Log::add($data['uid'], $data['oid'], \App\Config\Log::loanOperate('rc')); $this->success('操作成功'); } else { Log::add($data['uid'], $data['oid'], \App\Config\Log::loanOperate('rc_refuse')); $this->error('操作失败'); } } else { $this->error('验证失败'); } exit; } }
public function refaceAction($uid, $action = null) { if ($this->isAjax()) { $data = $this->request->getPost(); $model = new FaceForm('reface'); if ($model->validate($data)) { if ($model->reface()) { //更新状态 LoanSketch::updateStatus($data['uid'], \App\LoanStatus::getStatusReface()); Log::add($data['uid'], $this->getOperatorId(), \App\Config\Log::loanOperate('reface')); $this->success('操作成功'); } else { $this->error('操作失败'); } } else { $this->error('验证失败'); } exit; } empty($uid) and $this->pageError('param'); $infos = $this->detail($uid, ['user', 'face', 'loansketch']); $infos['uid'] = $uid; $infos['can_modify_actions'] = $this->canModifyActions($uid, $infos['loansketch']['status']); $infos['action'] = $action; $this->view->setVars($infos); $this->view->pick('loan/info/reface'); }
/** * 抵押公证 */ public function pledgenotaryAction() { if ($this->isAjax()) { $data = $this->request->getPost(); $uid = $data['uid']; !$uid and $this->error('参数错误'); $model = new LoanForm('pledge_notary'); $data['pledge_notary'] = 1; if ($result = $model->validate($data)) { if ($model->pledgenotary()) { Log::add($data['uid'], $this->getOperatorId(), \App\Config\Log::loanOperate('pledgenotary')); $this->success('操作成功'); } else { $this->error('操作失败'); } } else { $this->error('验证失败'); } exit; } }
public static function flush() { foreach (self::$logList as $logName => $lines) { $fileName = Config\Log::logFileName($logName); File::writeTo($fileName, implode("\n", $lines) . "\n"); } self::$logList = []; }
/** * 确认放款 */ public function confirmAction($uid) { if ($this->isAjax()) { !$uid and $this->error('参数错误'); if (Loan::updateStatus($uid, \App\LoanStatus::getStatusRunConfirm())) { Log::add($uid, $this->getOperatorId(), \App\Config\Log::loanOperate('runconfirm')); $this->success('操作成功'); } $this->error('操作失败'); } $loan = Loan::findByUid($uid); $user = User::findFirst($uid)->toArray(); $this->view->setVars(['loan' => $loan, 'user' => $user]); $this->view->pick('run/detail'); }