Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
a77f5a4
1
Parent(s):
b283eef
fix
Browse files
app/dialogflow/api/v1/dialogflow.py
CHANGED
|
@@ -306,6 +306,7 @@ async def get_trip_list(request: Request) -> Response:
|
|
| 306 |
try:
|
| 307 |
data = await dialog_service.search_trip(from_time, to_time, route_ids, ticket_count)
|
| 308 |
if len(data) > 0:
|
|
|
|
| 309 |
trip_by_time_office = dialog_service.get_trip_by_time_and_office_id(data, time, origin_id, dest_id)
|
| 310 |
# Nếu có chuyến xe theo thời gian và văn phòng chỉ định
|
| 311 |
if trip_by_time_office:
|
|
|
|
| 306 |
try:
|
| 307 |
data = await dialog_service.search_trip(from_time, to_time, route_ids, ticket_count)
|
| 308 |
if len(data) > 0:
|
| 309 |
+
################################## bug choox nay
|
| 310 |
trip_by_time_office = dialog_service.get_trip_by_time_and_office_id(data, time, origin_id, dest_id)
|
| 311 |
# Nếu có chuyến xe theo thời gian và văn phòng chỉ định
|
| 312 |
if trip_by_time_office:
|
app/dialogflow/services/dialog_service.py
CHANGED
|
@@ -121,9 +121,10 @@ class DialogService:
|
|
| 121 |
# Chuyến đi khớp với thời gian và văn phòng đón trả
|
| 122 |
@staticmethod
|
| 123 |
def get_trip_by_time_and_office_id(trips: list, time: str ,origin_id: int, dest_id: int) -> dict:
|
|
|
|
|
|
|
| 124 |
if time is None or origin_id is None or dest_id is None:
|
| 125 |
return {}
|
| 126 |
-
print(origin_id, dest_id)
|
| 127 |
for trip in trips:
|
| 128 |
if trip and trip["raw_departure_time"] == time and trip["route"]["origin_hub_office_id"] == origin_id and trip["route"]["dest_hub_office_id"] == dest_id:
|
| 129 |
return trip
|
|
|
|
| 121 |
# Chuyến đi khớp với thời gian và văn phòng đón trả
|
| 122 |
@staticmethod
|
| 123 |
def get_trip_by_time_and_office_id(trips: list, time: str ,origin_id: int, dest_id: int) -> dict:
|
| 124 |
+
print(origin_id, dest_id)
|
| 125 |
+
|
| 126 |
if time is None or origin_id is None or dest_id is None:
|
| 127 |
return {}
|
|
|
|
| 128 |
for trip in trips:
|
| 129 |
if trip and trip["raw_departure_time"] == time and trip["route"]["origin_hub_office_id"] == origin_id and trip["route"]["dest_hub_office_id"] == dest_id:
|
| 130 |
return trip
|