|
@@ -177,31 +177,27 @@ class RouteViewModel @Inject constructor() : ViewModel() {
|
|
|
|
|
|
fun GetOrgTour(numberTour: Int, titleCity:String) {
|
|
|
viewModelScope.launch {
|
|
|
- try {
|
|
|
- GetMetro(titleCity)
|
|
|
- withContext(Dispatchers.IO) {
|
|
|
- val columns = Columns.raw(
|
|
|
- """
|
|
|
+ GetMetro(titleCity)
|
|
|
+ withContext(Dispatchers.IO) {
|
|
|
+ val columns = Columns.raw(
|
|
|
+ """
|
|
|
id,
|
|
|
tours!inner(id,title),
|
|
|
- attractions!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,visiting,work_schedule,price_showing,photo,history,address,route,schedule_more,price,coordinates),
|
|
|
- hotels!inner(id,city!inner(id,country!inner(id,title,flag),title),rating,quantity_of_rooms,floors,name,photo_hotel,address,basic_info,interior,photo_interior,rooms,photo_room,services,price,coordinates),
|
|
|
- restaurants!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,work_schedule,phone,photo,address,basic_info,interior,recommendations,price,average_check,coordinates)
|
|
|
+ attractions!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,visiting,work_schedule,price_showing,photo,history,address,route,schedule_more,price,coordinates_x, coordinates_y),
|
|
|
+ hotels!inner(id,city!inner(id,country!inner(id,title,flag),title),rating,quantity_of_rooms,floors,name,photo_hotel,address,basic_info,interior,photo_interior,rooms,photo_room,services,price,coordinates_x, coordinates_y, check_in_out),
|
|
|
+ restaurants!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,work_schedule,phone,photo,address,basic_info,interior,recommendations,price,average_check,coordinates_x,coordinates_y)
|
|
|
""".trimIndent()
|
|
|
- )
|
|
|
- val responce = Constants.supabase.from("organization_of_tours").select(
|
|
|
- columns = columns
|
|
|
- ) {
|
|
|
- filter {
|
|
|
- eq("attractions.city.title", titleCity)
|
|
|
- }
|
|
|
- }.decodeList<Organization_of_tours>()
|
|
|
- val new_responce = responce.filter { it.tours.id == numberTour }
|
|
|
- _orgTour.value = new_responce
|
|
|
- Log.i("orgTour", titleCity)
|
|
|
- }
|
|
|
- }catch (e:Exception){
|
|
|
- Log.e("orgTour", "Error")
|
|
|
+ )
|
|
|
+ val responce = Constants.supabase.from("organization_of_tours").select(
|
|
|
+ columns = columns
|
|
|
+ ) {
|
|
|
+ filter {
|
|
|
+ eq("attractions.city.title", titleCity)
|
|
|
+ }
|
|
|
+ }.decodeList<Organization_of_tours>()
|
|
|
+ val new_responce = responce.filter { it.tours.id == numberTour }
|
|
|
+ _orgTour.value = new_responce
|
|
|
+ Log.i("orgTour", titleCity)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -223,7 +219,8 @@ class RouteViewModel @Inject constructor() : ViewModel() {
|
|
|
route,
|
|
|
schedule_more,
|
|
|
price,
|
|
|
- coordinates
|
|
|
+ coordinates_x,
|
|
|
+ coordinates_y
|
|
|
""".trimIndent()
|
|
|
)
|
|
|
val responce = Constants.supabase.from("attractions").select(
|
|
@@ -261,7 +258,9 @@ class RouteViewModel @Inject constructor() : ViewModel() {
|
|
|
photo_room,
|
|
|
services,
|
|
|
price,
|
|
|
- coordinates
|
|
|
+ coordinates_x,
|
|
|
+ coordinates_y,
|
|
|
+ check_in_out
|
|
|
""".trimIndent()
|
|
|
)
|
|
|
val responce = Constants.supabase.from("hotels").select(
|
|
@@ -297,7 +296,8 @@ class RouteViewModel @Inject constructor() : ViewModel() {
|
|
|
recommendations,
|
|
|
price,
|
|
|
average_check,
|
|
|
- coordinates
|
|
|
+ coordinates_x,
|
|
|
+ coordinates_y
|
|
|
""".trimIndent()
|
|
|
)
|
|
|
val responce = Constants.supabase.from("restaurants").select(
|