本文整理汇总了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.";
}
示例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...!');
}
}
示例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');
});
}
}
}
示例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'));
}
示例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();
}
示例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');
});
}