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


PHP Video::orderBy方法代码示例

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


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

示例1: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $banners = Banner::where('active', 'Y')->orderBy('id', 'desc')->get();
     $news = News::orderBy('date', 'desc')->take(5)->get();
     $videos = Video::orderBy('id', 'desc')->take(5)->get();
     return view('home', compact('banners', 'news', 'videos'));
 }
开发者ID:RelmekTaiwan,项目名称:sebamed,代码行数:12,代码来源:HomeController.php

示例2: show

 /**
  * Display the specified resource.
  *
  * @return Response
  */
 public function show()
 {
     $videos = Video::orderBy('id', 'asc')->get();
     return view('video', compact('videos'));
     /*		$functionalities = Functionality::all();
     
             return view('functionalities', compact('functionalities'));*/
 }
开发者ID:RelmekTaiwan,项目名称:sebamed,代码行数:13,代码来源:VideoController.php

示例3: paginate

 /**
  * Get paginated videos
  *
  * @param int $page Number of videos per page
  * @param int $limit Results per page
  * @param boolean $all Show published or all
  * @return StdClass Object with $items and $totalItems for pagination
  */
 public function paginate($page = 1, $limit = 10, $all = false, $notLazy = false)
 {
     $result = new \StdClass();
     $result->page = $page;
     $result->limit = $limit;
     $result->totalItems = 0;
     $result->items = array();
     $query = $this->video->orderBy('created_at', 'DESC')->where('lang', $this->getLang());
     $videos = $query->skip($limit * ($page - 1))->take($limit)->get();
     $result->totalItems = $this->totalVideos();
     $result->items = $videos->all();
     if (!$notLazy) {
         // set video details
         foreach ($result->items as $k => $v) {
             $v->setDetailsAttribute($this->getDetails($v['attributes']['type'], $v['attributes']['video_id']));
         }
     }
     return $result;
 }
开发者ID:phillipmadsen,项目名称:app,代码行数:27,代码来源:VideoRepository.php

示例4: index

 /**
  * Display a listing of videos
  *
  * @return Response
  */
 public function index()
 {
     $search_value = Input::get('s');
     if (!empty($search_value)) {
         $videos = Video::where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->paginate(9);
     } else {
         $videos = Video::orderBy('created_at', 'DESC')->paginate(9);
     }
     $user = Auth::user();
     $data = array('videos' => $videos, 'user' => $user, 'admin_user' => Auth::user());
     return View::make('admin.videos.index', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:17,代码来源:AdminVideosController.php

示例5: function

    return Redirect::to("/?s=1");
});
Route::get('contacto', function () {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return View::make('contacto', array('cita' => $cita, 'menu' => $menu));
});
Route::get('bio', function () {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return View::make('bio', array('cita' => $cita, 'menu' => $menu, 'bio' => DB::table('bio')->orderBy('id', 'desc')->first()));
});
Route::get('/', function () {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $galerias = Galeria::with('imagenes')->where('estado', '=', 'Activa')->orderBy('order')->get();
    $video = Video::orderBy('id')->first();
    $audio = Audio::orderBy('id')->first();
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return View::make('index', array('cita' => $cita, 'galerias' => $galerias, 'menu' => $menu, 'audio' => $audio, 'video' => $video));
});
Route::get('/imagen/{name}/{id}', function ($name, $id) {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $imagen = Imagen::find($id);
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return View::make('imagen', array('cita' => $cita, 'imagen' => $imagen, 'menu' => $menu));
});
Route::get('/video/{name}/{id}', function ($name, $id) {
    $cita = Cita::orderBy('created_at', 'desc')->first();
    $video = Video::find($id);
    $menu = Galeria::where('menu', '=', 'Si')->orderBy('order')->get();
    return Redirect::to($video->video);
开发者ID:pcerbino,项目名称:brea,代码行数:31,代码来源:routes.php


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