當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Event::select方法代碼示例

本文整理匯總了PHP中app\Event::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP Event::select方法的具體用法?PHP Event::select怎麽用?PHP Event::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Event的用法示例。


在下文中一共展示了Event::select方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCalendar

 public function getCalendar()
 {
     $eventos = Event::select('titulo_evento')->where('user_id', '=', Auth::user()->id)->take(4)->get();
     //$datos['cTrabajo']= \DB::table('trabajo')->count();
     $array = Event::where('user_id', '=', Auth::user()->id)->get();
     return view('Calendar/calendar', compact('array', 'datos', 'eventos'));
 }
開發者ID:TeDyGuN,項目名稱:SIS-EAEN,代碼行數:7,代碼來源:FullCalendarController.php

示例2: eventsUsuari

 public static function eventsUsuari($cultius)
 {
     if (!is_null($cultius)) {
         //	foreach ($cultius as $cultiu){
         //		dd($cultiu);
         if (!is_null($cultius)) {
             $results = Event::select('id', 'headline', 'text', 'startDate', 'cultiu_id')->where(function ($query) use($cultius) {
                 foreach ($cultius as $value) {
                     if (!is_null($value)) {
                         //you can use orWhere the first time, dosn't need to be ->where
                         $query->orWhere('cultiu_id', $value['id']);
                     }
                 }
             })->orderBy('updated_at', 'desc')->get()->toArray();
             foreach ($results as $passa) {
                 $dades[] = $passa;
             }
         }
         //}
     }
     //dd($dades);
     if (!is_null($dades)) {
         return $dades;
     }
 }
開發者ID:vi1004t,項目名稱:pfg,代碼行數:25,代碼來源:Event.php

示例3: events

 public function events(Request $request)
 {
     if ($request->start && $request->end) {
         return Event::whereRaw("start between '" . $request->start . "' and '" . $request->end . "'")->with("order")->get();
     } else {
         return Event::select("*")->get();
     }
 }
開發者ID:znittzel,項目名稱:datianew,代碼行數:8,代碼來源:CalendarController.php

示例4: overview

 /**
  * Display events that require CERFs.
  *
  * @return \Illuminate\View\View
  */
 public function overview()
 {
     // Ensures only events created after implementation of online CERFs system are checked.
     $oldestAllowed = Carbon::create(2015, 11, 1, 8, 0, 0, 'UTC');
     $newestAllowed = Carbon::now();
     // Finds IDs of all events that do not have an associated approved CERF.
     $eventIdsWithoutCerfs = Event::select('events.id')->leftJoin('cerfs', 'events.id', '=', 'cerfs.event_id')->whereNull('cerfs.id')->orWhere('cerfs.approved', false)->get();
     // TODO Paginate events that need to be CERFed.
     // Retrieves events without CERFs based on ID. Casts to array to pass to foreach loop in view.
     $eventsWithoutCerfs = Event::find($eventIdsWithoutCerfs->toArray());
     $userCerfs = Cerf::where('reporter_id', Auth::id())->where('approved', false)->get();
     return view('pages.cerfs.overview', compact('eventsWithoutCerfs', 'userCerfs', 'oldestAllowed', 'newestAllowed'));
 }
開發者ID:natalieduong,項目名稱:konnection,代碼行數:18,代碼來源:CerfsController.php

示例5: index

 public function index()
 {
     /* Get data for timeline */
     $eventDates = \App\Event::select('timelineDate')->distinct()->get()->pluck('timelineDate')->toArray();
     $mediaDates = \App\Media::select('timelineDate')->distinct()->get()->pluck('timelineDate')->toArray();
     $dates = array_unique(array_merge($eventDates, $mediaDates), SORT_REGULAR);
     usort($dates, array('\\App\\Http\\Controllers\\TimelineController', 'dateCompare'));
     $media = array();
     $events = array();
     foreach ($dates as $date) {
         $eventsForThisDate = \App\Event::get()->where('timelineDate', $date)->toArray();
         $mediaForThisDate = \App\Media::get()->where('timelineDate', $date)->toArray();
         usort($eventsForThisDate, array('\\App\\Http\\Controllers\\TimelineController', 'itemCompare'));
         usort($mediaForThisDate, array('\\App\\Http\\Controllers\\TimelineController', 'itemCompare'));
         $media[$date] = $mediaForThisDate;
         $events[$date] = $eventsForThisDate;
     }
     /* Get data for filters */
     $mediums = \App\Media::select('medium')->distinct()->get()->pluck('medium')->toArray();
     $tags = \App\EventTag::select('tag')->distinct()->get()->pluck('tag')->toArray();
     $series = \App\Series::get()->pluck('seriesAbbreviation');
     sort($mediums);
     sort($tags);
     $eventIDToTags = array();
     $eventIDs = \App\Event::get()->pluck('id');
     foreach ($eventIDs as $eventID) {
         $eventIDToTags[$eventID] = \App\EventTag::select('tag')->where('eventID', $eventID)->get()->pluck('tag')->toArray();
     }
     $seriesToCollections = array();
     foreach ($series as $thisSeries) {
         $seriesToCollections[$thisSeries] = \App\Media::select('collection')->where('series', $thisSeries)->distinct()->get()->pluck('collection')->toArray();
     }
     /* Get event-media relationships */
     $eventMediaPairs = \App\EventMedia::get(array('eventID', 'mediaID'))->toArray();
     return view('timeline')->with(['seriesToCollections' => $seriesToCollections, 'eventMediaPairs' => $eventMediaPairs, 'eventIDToTags' => $eventIDToTags, 'mediums' => $mediums, 'events' => $events, 'dates' => $dates, 'media' => $media, 'tags' => $tags]);
 }
開發者ID:erikkacsm,項目名稱:timeline,代碼行數:36,代碼來源:TimelineController.php

示例6: getTittlesEvents

 public function getTittlesEvents()
 {
     $eventos = Event::select('titulo_evento')->where('user_id', '=', Auth::user()->id)->take(4)->get();
     return $eventos;
 }
開發者ID:TeDyGuN,項目名稱:SIS-EAEN,代碼行數:5,代碼來源:CalendarInjectionController.php

示例7: index

 /**
  * View a list of events.
  * @return mixed
  */
 public function index()
 {
     $events = Event::select('events.*')->join('event_times', 'events.id', '=', 'event_times.event_id')->orderBy('event_times.start', 'DESC')->distinct()->distinctPaginate(15);
     $this->checkPagination($events);
     return View::make('events.index')->withEvents($events);
 }
開發者ID:backstagetechnicalservices,項目名稱:website,代碼行數:10,代碼來源:EventsController.php

示例8: editEventInfo

 /**
  * Show the form for editing an existing event's info.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function editEventInfo($id)
 {
     $event = Event::select('events.*')->where('id', '=', $id)->firstorfail();
     return view('admin/edit', ['event' => $event]);
 }
開發者ID:xRokco,項目名稱:websysproject,代碼行數:11,代碼來源:AdminController.php


注:本文中的app\Event::select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。