protected function addActualAddonTakers($reservation_id, $addonInfo)
 {
     //print_r($addonInfo);die;
     $statusCancelledNew = DB::select(DB::raw('select * from reservation_status_log having reservation_id = ' . $reservation_id . ' and created_at in (SELECT MAX(created_at) FROM reservation_status_log group by reservation_id)'));
     $reservationIdArr = array();
     foreach ($statusCancelledNew as $reservId) {
         $statusId = $reservId->new_reservation_status_id;
     }
     foreach ($addonInfo as $prod_id => $count) {
         /*$result = ReservAddonVarientDetails::where('options_id',$prod_id)->where('reservation_id',$reservation_id)->first();
           $result->reservation_status_id = $statusId;
           $result->save();*/
         if ($count > 0) {
             $result = new ReservAddonVarientDetails();
             $result->no_of_persons = $count;
             $result->options_id = $prod_id;
             $result->option_type = 'addon';
             $result->reservation_type = 'experience';
             $result->reservation_id = $reservation_id;
             $result->reservation_status_id = $statusId;
             $result->save();
         }
     }
     return 1;
 }
Beispiel #2
0
 public static function getReservationAddonDetails($reservationID)
 {
     $addonDetails = ReservAddonVarientDetails::where('reservation_id', $reservationID)->get();
     return $addonDetails;
 }