本文整理匯總了PHP中Guest::join方法的典型用法代碼示例。如果您正苦於以下問題:PHP Guest::join方法的具體用法?PHP Guest::join怎麽用?PHP Guest::join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Guest
的用法示例。
在下文中一共展示了Guest::join方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: showInvoice
public function showInvoice($bookCode)
{
$about = About::all();
$booking = DetailBooking::join('booking', 'booking.ID_Booking', '=', 'detail_booking.ID_Booking')->join('roomtype', 'roomtype.ID_RoomType', '=', 'detail_booking.ID_RoomType')->join('guest', 'guest.ID_Booking', '=', 'detail_booking.ID_Booking')->join('payment', 'payment.ID_Booking', '=', 'detail_booking.ID_Booking')->join('extra', 'extra.ID_Booking', '=', 'detail_booking.ID_Booking')->where('booking.Booking_code', '=', $bookCode)->get();
$guest = Guest::join('booking', 'booking.ID_Booking', '=', 'guest.ID_Booking')->where('booking.Booking_code', '=', $bookCode)->get();
$tax = Tax::where('Status', '=', 'Active')->get();
$detailAdd = DetailBooking::join('booking', 'booking.ID_Booking', '=', 'detail_booking.ID_Booking')->join('detail_additional', 'detail_additional.ID_Booking', '=', 'detail_booking.ID_Booking')->join('additional', 'additional.ID_Additional', '=', 'detail_additional.ID_Additional')->where('booking.Booking_code', '=', $bookCode)->get();
$totalRoom = 0;
foreach ($booking as $key => $value1) {
$totalRoom += $value1->Price * $value1->Quantity * $value1->Number_nights;
}
//dd($totalRoom);
$totalAdd = 0;
foreach ($detailAdd as $key => $value) {
$totalAdd += $value->Price * $value->Quantity;
}
//dd($totalAdd);
$totalTax = 0;
foreach ($tax as $key => $value2) {
$totalTax += ($totalAdd + $totalRoom) * $value2->Tax;
}
//dd($totalTax);
$grandTotal = $totalAdd + $totalRoom + $totalTax;
//dd($grandTotal);
return View::make('Books.View.show')->with('booking', $booking)->with('about', $about)->with('guest', $guest)->with('tax', $tax)->with('detailAdd', $detailAdd)->with('totalRoom', $totalRoom)->with('totalAdditional', $totalAdd)->with('totalTax', $totalTax)->with('grandTotal', $grandTotal);
}