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


PHP Guest::join方法代码示例

本文整理汇总了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);
 }
开发者ID:hilmysyarif,项目名称:hotel-application-laravel,代码行数:26,代码来源:BooksController.php


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