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


PHP Movie::orderBy方法代码示例

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


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

示例1: getMemberHome

 public function getMemberHome()
 {
     date_default_timezone_set(config::$timezone);
     $today = date("Y-m-d");
     // Holding watched movies id
     $watchedMovies = Order::where('member_id', '=', Session::get('member_id'))->select('movie_id')->get()->toArray();
     // Building query whare id = ? or id = ? so on
     $ids = 'id = ?';
     for ($i = 1; $i < count($watchedMovies); $i++) {
         $ids .= ' or id = ?';
     }
     $memberWatchedMovies = Movie::orWhereRaw($ids, $watchedMovies)->get();
     return View::make('adminArea/home/member-dashboard')->with('newMovies', Movie::orderBy('id', 'desc')->get()->take(20))->with('watchedMovies', $memberWatchedMovies);
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:14,代码来源:HomeController.php

示例2: postAction

 /**
  *  This function responses  to the 
  *  post request of the /admin/movie/action
  *  then checked which button is pressed in the
  *  form of movie.view.blade.php of the 
  *  route /admin/movie
  */
 public function postAction()
 {
     // Holding checked row value from movie table
     $id = Input::get('checked');
     /**
      *  Redirected route if Edit button is pressed
      */
     if (Input::has('Edit')) {
         return Redirect::route('movie-edit-get', $id);
     }
     /**
      *  Redirected route if Details button is pressed
      */
     if (Input::has('Details')) {
         return Redirect::route('movie-details-get', $id);
     }
     /**
      *  Redirected route if Print button is pressed
      */
     if (Input::has('Print')) {
         $parameterr = array();
         $parameter['movies'] = Movie::orderBy('id', 'desc')->get();
         $pdf = PDF::loadView('reports.movie.getAllMovies', $parameter)->setPaper('a4')->setOrientation(config::$MOVIE_REPORT_ORIENTATION)->setWarnings(false);
         return $pdf->stream('movies.pdf');
     }
     /**
      *  If Delete button is pressed
      *  destroy function finds movie by id
      *  and deletes the movie from movie table
      */
     if (Input::has('Delete')) {
         foreach ($id as $movieId) {
             $movie = Movie::find($movieId);
             $movie->delete();
         }
         return Redirect::route('movie-get', 1);
     }
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:45,代码来源:MovieController.php

示例3: index

 /**
  * Laravel sends content to the frontend as JSON
  *
  * @return Response
  */
 public function index()
 {
     return Response::json(Movie::orderBy('id', 'desc')->get());
 }
开发者ID:metalikium,项目名称:watch-it-later,代码行数:9,代码来源:MovieController.php

示例4: getMovie

 /**
  *  This function responses to
  *  the get request of /member/movie
  *  and show all movie as list
  */
 public function getMovie()
 {
     return View::make('adminArea.movie.view')->with('movies', Movie::orderBy('id', 'desc')->get());
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:9,代码来源:MemberHomeController.php


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