コード例 #1
0
ファイル: GpsController.php プロジェクト: Crocodile26/php-1
 /**
  * GPS安装
  */
 public function gpsAction()
 {
     if ($this->isAjax()) {
         $data = $this->request->getPost();
         $uid = $data['uid'];
         !$uid and $this->error('参数错误');
         $data['gps'] = 1;
         $model = new LoanForm('gps');
         if ($result = $model->validate($data)) {
             if ($model->sign()) {
                 Log::add($uid, $this->getOperatorId(), \App\Config\Log::loanOperate('gps'));
                 $this->success('操作成功');
             } else {
                 $this->error('操作失败');
             }
         } else {
             $this->error('验证失败');
         }
         exit;
     }
     $uid = $this->urlParam();
     empty($uid) and $this->pageError('param');
     $loan = Loan::findByUid($uid);
     $user = User::findFirst($uid)->toArray();
     $this->view->setVars(['loan' => $loan, 'user' => $user]);
     $this->view->pick('afterrc/detail');
 }
コード例 #2
0
 public function detailAction()
 {
     $uid = $this->urlParam();
     empty($uid) and $this->pageError('param');
     $loan = Loan::findByUid($uid);
     $user = User::findFirst($uid)->toArray();
     $this->view->setVars(['loan' => $loan, 'user' => $user]);
 }
コード例 #3
0
 /**
  * 贷款详情
  */
 public function detailAction()
 {
     $uid = $this->urlParam();
     !$uid and $this->pageError('param');
     $detail = Loan::findByUid($uid);
     !$detail and $this->pageError('param');
     $repayList = Repay::findByUid($uid);
     $this->view->setVars(['detail' => $detail, 'repayList' => $repayList]);
 }
コード例 #4
0
ファイル: Loan.php プロジェクト: Crocodile26/php-1
 public static function infos($uid)
 {
     $infos = User::infos($uid);
     $infos['loan'] = Loan::findByUid($uid);
     return $infos;
 }
コード例 #5
0
ファイル: User.php プロジェクト: Crocodile26/php-1
 /**
  * 获取贷款所有信息、全国风控提交之前的数据
  */
 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;
 }
コード例 #6
0
 /**
  * 合同签署
  */
 public function signAction()
 {
     if ($this->isAjax()) {
         $data = $this->request->getPost();
         $uid = $data['uid'];
         !$uid and $this->error('参数错误');
         $data['begintime'] = strtotime(date('Y-m-d 23:59:59', time()));
         //还款开始时间,签署合同当天23:59:59秒计时
         //$data['status']	= \App\LoanStatus::getStatusRepay();
         $data['return_num'] = 0;
         $data['return_amount'] = 0;
         $data['last_repay_time'] = $data['begintime'];
         $data['next_repay_time'] = strtotime('+1 month', $data['begintime']);
         $data['endtime'] = 0;
         $model = new LoanForm('contractSign');
         if ($result = $model->validate($data)) {
             if ($model->sign()) {
                 Log::add($data['uid'], $this->getOperatorId(), \App\Config\Log::loanOperate('sign'));
                 $this->success('操作成功');
             } else {
                 $this->error('操作失败');
             }
         } else {
             $this->error('验证失败');
         }
         exit;
     }
     $uid = $this->urlParam();
     empty($uid) and $this->pageError('param');
     $loan = Loan::findByUid($uid);
     $user = User::findFirst($uid)->toArray();
     $this->view->setVars(['loan' => $loan, 'user' => $user]);
     $this->view->pick('afterrc/detail');
 }
コード例 #7
-2
ファイル: RunController.php プロジェクト: Crocodile26/php-1
 /**
  * 确认放款
  */
 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');
 }