| Version 3 (modified by , 12 months ago) ( diff ) |
|---|
Actors
- Signed-in User
Steps
- The user logs into the system
- The user clicks on the ‘My Trips’ tab
SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time
FROM ticket as tick
JOIN trip on trip.trip_id = tick.trip_id
JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id
JOIN route as r ON trip.route_id = r.route_id
JOIN location as lf on r.from_location_id = lf.location_id
JOIN location as lt on r.to_location_id = lt.location_id
JOIN trip_stops as stop on lf.location_id = stop.location_id
WHERE tick.account_id = {account_lists_id};
- (Optional) The user selects a status on which to filter their trips. By default, all trips are displayed.
- (Optional) The user selects a company on which to filter their trips. By default, all trips are displayed.
- (Optional) The user selects a date range in which their trips were completed. By default, all trips are displayed.
SELECT lf.name, lt.name, trip.free_seats, trip.date, t_o.company_name, stop_time
FROM ticket as tick
JOIN trip on trip.trip_id = tick.trip_id
JOIN transport_organizer as t_o ON trip.transport_organizer_id = t_o.transport_organizer_id
JOIN route as r ON trip.route_id = r.route_id
JOIN location as lf on r.from_location_id = lf.location_id
JOIN location as lt on r.to_location_id = lt.location_id
JOIN trip_stops as stop on lf.location_id = stop.location_id
WHERE tick.account_id = {account_lists_id}
AND status = {selected_status} -- Optional
AND (trip.date < {before_date} AND trip.date < {after_date}) -- Optional
AND t_o.company_name = {selected_company_name}; -- Optional
- The user is displayed their trips.
Note:
See TracWiki
for help on using the wiki.
