示例#1
0
 private function setData($identification)
 {
     $extracts = Extract::where("nit", $identification)->orderBy('id', 'DESC')->get();
     if ($extracts) {
         $user = User::whereRaw("roles_id = 4 and identification_card = {$identification}")->first();
         $minPay = ExcelDaily::where("cedula", $identification)->get();
         $quota = CreditRequest::where('user_id', $user->id)->first();
         $day = explode('-', date("y-m-d"));
         $q = $quota ? $quota->value : 300000;
         $this->data = ['user' => $user, 'day' => $day, 'extracts' => $extracts, 'quota' => intval($q), 'minPay' => $minPay, 'months' => $this->getMonths()];
         return true;
     }
     return false;
 }
示例#2
0
 public function showState()
 {
     $user = Auth::user();
     $credit = CreditRequest::where('user_id', $user->id)->first();
     $extracts = Extract::where('nit', $user->identification_card)->get();
     $vencidos = 0;
     $debe = 0;
     foreach ($extracts as $extract) {
         $vencidos += intval($extract->dias_vencidos);
         $debe += intval($extract->saldo_credito_diferido);
     }
     return View::make('front.state', compact('extracts', 'vencidos', 'debe', 'user', 'credit'));
 }