Spaces:
Sleeping
Sleeping
OnlyBiggg
commited on
Commit
·
ff4d910
1
Parent(s):
286e42f
fix
Browse files
app/dialogflow/api/v1/dialogflow.py
CHANGED
|
@@ -306,16 +306,14 @@ 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 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
if trip_by_time_office:
|
| 314 |
-
parameters = {
|
| 315 |
"is_valid_trip": True,
|
| 316 |
"trip": trip_by_time_office
|
| 317 |
}
|
| 318 |
-
|
| 319 |
|
| 320 |
# Danh sách chuyến xe khớp với văn phòng đón hoặc văn phòng trả
|
| 321 |
if origin_office and dest_office:
|
|
|
|
| 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:
|
| 312 |
+
parameters = {
|
|
|
|
|
|
|
| 313 |
"is_valid_trip": True,
|
| 314 |
"trip": trip_by_time_office
|
| 315 |
}
|
| 316 |
+
return DialogFlowResponseAPI(parameters=parameters)
|
| 317 |
|
| 318 |
# Danh sách chuyến xe khớp với văn phòng đón hoặc văn phòng trả
|
| 319 |
if origin_office and dest_office:
|