where('is_active', 1)->findAll(); } // Get a specific flight trip by ID public function getTripById($tripId) { return $this->where('flight_trip_id', $tripId)->first(); } // Get trips by flight ID public function getTripsByFlightId($flightId) { return $this->where('flight_id', $flightId)->where('is_active', 1)->findAll(); } // Insert a new flight trip public function insertTrip($data) { return $this->insert($data); } // Update an existing flight trip public function updateTrip($tripId, $data) { return $this->where('flight_trip_id', $tripId)->set($data)->update(); } // Soft delete (deactivate) a flight trip public function deactivateTrip($tripId) { return $this->where('flight_trip_id', $tripId)->set(['is_active' => 0])->update(); } }