示例#1
0
 /**
  * [FunctionName description]
  * @param string $value [description]
  */
 public function activity()
 {
     $lastdate = \Carbon\Carbon::now()->subMonths(3);
     $checkins = $this->checkins->with('driver')->select(\DB::raw("*, COUNT(*) as activity , \n                            MONTHNAME(operasi_time) as mountname,\n                            MONTH(operasi_time) as mount"))->where('pool_id', $this->user->pool_id)->where('operasi_status_id', 1)->where('operasi_time', '>=', $lastdate->format('Y-m-d'))->where(\DB::raw('YEAR(operasi_time)'), date('Y'))->groupBy('driver_id')->groupBy(\DB::raw('MONTH(operasi_time)'))->get();
     //dd($drivers);
     return view('drivers.activity', compact('checkins'));
 }
 /**
  * Metodo que recebe a view tanto do provider, quanto por ajax
  * 
  * @param  [type] $view [description]
  * @return  Collection 	as notificacoes do tipo 'geral'(nao seguidor ou chat)
  */
 public function getNotificacoesgeral($view = null)
 {
     $notificacoes = Auth::user()->entidadeAtiva->notificacoesWarning;
     if (Request::ajax()) {
         return view('_notificacoesGeral')->with('notificacoes', $notificacoes);
     }
     $view->with('notificacoes', $notificacoes);
 }