当前位置: 首页>>代码示例>>PHP>>正文


PHP Event::take方法代码示例

本文整理汇总了PHP中app\Event::take方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::take方法的具体用法?PHP Event::take怎么用?PHP Event::take使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Event的用法示例。


在下文中一共展示了Event::take方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $events = Event::take('4')->get();
     $authors = Author::take('4')->get();
     $coverage = DB::table('press')->take('4')->orderBy('press_date', 'desc')->get();
     return view('welcome', compact('events', 'authors', 'coverage'));
 }
开发者ID:palhimanshu1991,项目名称:dastangoi,代码行数:12,代码来源:WelcomeController.php

示例2: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     try {
         $isInstalled = Setting::where('name', 'is_installed')->firstOrFail();
     } catch (ModelNotFoundException $e) {
         $isInstalled = Setting::create(['name' => 'is_installed', 'setting' => 'no']);
     }
     if ($isInstalled->setting != 'yes') {
         return Redirect::route('install');
     }
     $data = ["event" => Event::first(), "upcomingEvents" => Event::take(3)->get(), "news" => News::take(6)->get(), "media" => Media::where('processed', true)->orderBy('id', 'DESC')->take(12)->get()];
     return view('home')->with($data);
 }
开发者ID:TheJokersThief,项目名称:Eve,代码行数:18,代码来源:HomeController.php

示例3: scanIsInsideParcel

 public function scanIsInsideParcel()
 {
     $this->middleware('auth');
     $pointLocation = new PointLocation();
     $events = Event::take(1000)->orderBy('dateGps', 'ASC')->get();
     foreach ($events as $key => $value) {
         $latLonEvent = $value->lat . "," . $value->lon;
         $event = $value;
         $parcels = Parcel::orderByRaw('lat - ' . $value->lat . '', 'ASC')->take(20)->get();
         foreach ($parcels as $key => $value) {
             $isPointInside = 0;
             $parcelsGps = ParcelGps::where('idparcel', $value->id)->orderBy('number', 'ASC')->get();
             $polygon = array();
             foreach ($parcelsGps as $key => $value) {
                 $latlng = "" . $value->lat . ", " . $value->long . "";
                 $idparcelEvent = $value->idparcel;
                 array_push($polygon, $latlng);
             }
             $isPointInside = $pointLocation->pointInPolygon($latLonEvent, $polygon, $event, $idparcelEvent);
             if ($isPointInside == 1) {
                 $event = Event::find($event->id);
                 $event->isSync = 1;
                 $event->isInside = 1;
                 $event->idParcelle = $idparcelEvent;
                 $event->save();
                 $eventprocessed = new ProcessedEvents();
                 $eventprocessed->idApp = $event->idApp;
                 $eventprocessed->idUser = $event->idUser;
                 $eventprocessed->name = $event->name;
                 $eventprocessed->lon = $event->lon;
                 $eventprocessed->lat = $event->lat;
                 $eventprocessed->dateGps = $event->dateGps;
                 $eventprocessed->timeDate = $event->timeDate;
                 $eventprocessed->isInside = $event->isInside;
                 $eventprocessed->idParcelle = $event->idParcelle;
                 $eventprocessed->altitude = $event->altitude;
                 $eventprocessed->isSync = $event->isSync;
                 $eventprocessed->save();
                 break;
             }
             if ($isPointInside == 0) {
                 $event = Event::find($event->id);
                 $event->isSync = 1;
                 $event->isInside = 0;
                 $event->idParcelle = 0;
                 $event->save();
             }
         }
     }
 }
开发者ID:BBerthod,项目名称:AgreenWeb,代码行数:50,代码来源:EventController.php

示例4: showParcelsEvents

 public function showParcelsEvents()
 {
     $events = Event::take(100)->get();
     $users = User::all();
     $parcels = Parcel::all();
     $parcelsGpsArray = [];
     foreach ($parcels as $key => $value) {
         $parcelsGps = ParcelGps::where('idparcel', $value->id)->orderBy('number')->select('lat', 'long')->get();
         array_push($parcelsGpsArray, $parcelsGps);
     }
     // load the view and pass the parcels
     return View::make('app.parcel.showevent')->with('parcels', $parcelsGpsArray)->with('events', $events)->with('users', $users);
 }
开发者ID:BBerthod,项目名称:AgreenWeb,代码行数:13,代码来源:ParcelController.php

示例5: getListEvents

 public function getListEvents()
 {
     $events = Event::take(2);
     return $events;
 }
开发者ID:aflashyrhetoric,项目名称:pray,代码行数:5,代码来源:ListEvents.php


注:本文中的app\Event::take方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。