本文整理汇总了PHP中Tax::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Tax::where方法的具体用法?PHP Tax::where怎么用?PHP Tax::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tax
的用法示例。
在下文中一共展示了Tax::where方法的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);
}