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


PHP Movie::where方法代码示例

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


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

示例1: DeadLineFinished

 public static function DeadLineFinished()
 {
     date_default_timezone_set(config::$timezone);
     $today = date("Y-m-d");
     $orders = Order::where('to', '<', $today)->where('status', '=', 1)->orderBy('id', 'desc')->get();
     $info = array();
     $x = 0;
     foreach ($orders as $order) {
         $single = array();
         $single['email'] = User::where('details_id', '=', $order->member->id)->where('user_level', '=', 'member')->get()->first()->email;
         $single['movie name'] = Movie::where("id", '=', $order->movie_id)->get()->first()->name;
         $single['first name'] = Member::where("id", '=', $order->member_id)->get()->first()->first_name;
         $single['last name'] = Member::where("id", '=', $order->member_id)->get()->first()->last_name;
         $info[$x++] = $single;
     }
     foreach ($info as $member) {
         Mail::send('emails.deadlinefinishedorder', array('first_name' => $member['first name'], 'last_name' => $member['last name'], 'movie' => $member['movie name']), function ($message) use($member) {
             $message->to($member['email'], $member['first name'])->subject('DVD Rental Notification');
         });
     }
     return "Email has been successfully sent.";
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:22,代码来源:OrderMail.php

示例2: getDeleteMovie

 public function getDeleteMovie($id)
 {
     $movie = Movie::where('id', '=', $id)->first();
     if ($movie) {
         $movie->delete();
         return Redirect::to('/browse-movies')->with('flash_message', 'Delete successfuly!');
     } else {
         return Redirect::to('/browse-movies')->with('flash_message', 'Delete failed! Try again...!');
     }
 }
开发者ID:tylerrehm07,项目名称:csci-e15,代码行数:10,代码来源:MovieController.php

示例3: newReviewMail

 public function newReviewMail($film, $review)
 {
     //Get All Followers of the loggedn in user
     $users = new UsersController();
     $followers = $users->getFollower(Auth::user()->id);
     $movie = Movie::where('fl_id', $film)->first();
     foreach ($followers as $subject) {
         // if the subject is 1 or greater than 200 to avoid spam mail
         if ($subject->id > 200 || $subject->id == 1) {
             //The follower to whom this email will be sent
             $user = User::where('id', $subject->id)->first();
             if ($movie->fl_image) {
                 $filmImage = 'http://www.berdict.com/public/uploads/movie/' . $movie->fl_year . '/' . $movie->fl_image;
             } else {
                 $filmImage = 'http://www.berdict.com/public/berdict/img/default_poster.jpg';
             }
             $filmUrl = 'http://www.berdict.com/movie/' . $movie->fl_id . '/' . Common::cleanUrl($movie->fl_name);
             $subjectEmail = $user->usr_email;
             $subjectName = $user->usr_fname . ' ' . $user->usr_lname;
             $emailSubject = 'Hey ' . $user->usr_fname . '! Your friend ' . Auth::user()->usr_fname . ' ' . Auth::user()->usr_lname . ' wrote a review for ' . $movie->fl_name;
             $data = array('subjectName' => $user->usr_fname, 'filmName' => $movie->fl_name, 'filmYear' => $movie->fl_year, 'filmUrl' => $filmUrl, 'filmImage' => $filmImage, 'filmReview' => $review->fr_review, 'reviewId' => $review->fr_id, 'objectId' => Auth::user()->id, 'objectName' => Auth::user()->usr_fname . ' ' . Auth::user()->usr_lname, 'objectUsername' => Auth::user()->username, 'filmName' => $movie->fl_name);
             Mail::send('emails.newReview', $data, function ($message) use($subjectEmail, $subjectName, $emailSubject) {
                 $message->to($subjectEmail, $subjectName);
                 $message->subject($emailSubject);
                 $message->from('no-reply@berdict.com', 'Berdict');
             });
         }
     }
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:29,代码来源:ReviewsController.php

示例4: genre

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function genre($genre)
 {
     $query = '%' . $genre . '%';
     $movies = Movie::where('fl_genre', 'LIKE', $query)->orderBy('fl_rating', 'desc')->paginate(20);
     $this->layout->content = View::make('movies.genre', compact('movies', 'genre'));
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:11,代码来源:MoviesController.php

示例5: countryUpdate

 public function countryUpdate()
 {
     $star = Input::get('star');
     $country = Input::get('country');
     $start = Input::get('start');
     $end = Input::get('end');
     if ($star == "" || ($country = "")) {
         return Redirect::to('/country')->with('flash_error', 'Please enter all the details.')->withInput();
     }
     $movie = Movie::where('fl_stars', 'LIKE', '%' . $star . '%')->whereBetween('fl_id', array($start, $end))->get();
     foreach ($movie as $film) {
         if ($film->fl_country == "" || $film->fl_country == null) {
             DB::table('film')->where('fl_id', $film->fl_id)->update(array('fl_country' => $country));
         }
     }
     return Redirect::to('/country')->with('flash_success', 'Country updated.')->withInput();
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:17,代码来源:HomeController.php

示例6: newLikeMail

 public function newLikeMail($subject, $film, $review, $random)
 {
     $user = User::where('id', $subject)->first();
     $Ruser = User::where('id', $random)->first();
     $movie = Movie::where('fl_id', $film)->first();
     if ($movie->fl_image) {
         $filmImage = 'http://www.berdict.com/public/uploads/movie/' . $movie->fl_year . '/' . $movie->fl_image;
     } else {
         $filmImage = 'http://www.berdict.com/public/berdict/img/default_poster.jpg';
     }
     $filmUrl = 'http://www.berdict.com/movie/' . $movie->fl_id . '/' . Common::cleanUrl($movie->fl_name);
     $subjectEmail = $user->usr_email;
     $subjectName = $user->usr_fname . ' ' . $user->usr_lname;
     $emailSubject = '' . $user->usr_fname . '! ' . $Ruser->usr_fname . ' ' . $Ruser->usr_lname . ' agreed with your review for ' . $movie->fl_name;
     $data = array('subjectName' => $user->usr_fname, 'filmName' => $movie->fl_name, 'filmYear' => $movie->fl_year, 'filmUrl' => $filmUrl, 'filmImage' => $filmImage, 'filmReview' => $review->fr_review, 'reviewId' => $review->fr_id, 'objectId' => $Ruser->id, 'objectName' => $Ruser->usr_fname . ' ' . $Ruser->usr_lname, 'objectUsername' => $Ruser->username, 'filmName' => $movie->fl_name);
     Mail::send('emails.agree', $data, function ($message) use($subjectEmail, $subjectName, $emailSubject) {
         $message->to($subjectEmail, $subjectName);
         $message->subject($emailSubject);
         $message->from('no-reply@berdict.com', 'Berdict');
     });
 }
开发者ID:palhimanshu1991,项目名称:berdict,代码行数:21,代码来源:AdminController.php


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