fix timezone - time with local timezone to default timezone

This commit is contained in:
pyaephyoeaung
2022-05-19 14:20:55 +06:30
parent 7598a96e60
commit 214712fd2d
48 changed files with 294 additions and 305 deletions

View File

@@ -90,7 +90,7 @@ class Oqs::HomeController < BaseOqsController
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("assigned_order_items.delivery_status = 0 AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}'")
.where("assigned_order_items.delivery_status = 0 AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.current.beginning_of_day.utc}'")
.group("assigned_order_items.assigned_order_item_id")
.order("assigned_order_items.created_at")
end
@@ -106,7 +106,7 @@ class Oqs::HomeController < BaseOqsController
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("assigned_order_items.delivery_status = true AND odt.price <> 0 AND assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'")
.where("assigned_order_items.delivery_status = true AND odt.price <> 0 AND assigned_order_items.created_at between '#{Time.current.beginning_of_day.utc}' and '#{Time.current.end_of_day.utc}'")
.group("assigned_order_items.order_id")
.limit(20)
.order("assigned_order_items.created_at")

View File

@@ -192,7 +192,7 @@ class Oqs::HomeController < BaseOqsController
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs} #{table} #{queue_status}")
.where("assigned_order_items.created_at >= '#{Time.current.beginning_of_day.utc}' #{oqs} #{table} #{queue_status}")
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
.order("assigned_order_items.assigned_order_item_id desc")
.group("odt.order_items_id")
@@ -210,7 +210,7 @@ class Oqs::HomeController < BaseOqsController
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("assigned_order_items.delivery_status = true AND assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'")
.where("assigned_order_items.delivery_status = true AND assigned_order_items.created_at between '#{Time.current.beginning_of_day.utc}' and '#{Time.current.end_of_day.utc}'")
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
.group("assigned_order_items.order_id")
.limit(50)
@@ -231,7 +231,7 @@ class Oqs::HomeController < BaseOqsController
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'")
.where("assigned_order_items.created_at between '#{Time.current.beginning_of_day.utc}' and '#{Time.current.end_of_day.utc}'")
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
.group("odt.order_items_id")
.order("assigned_order_items.created_at desc")
@@ -266,7 +266,7 @@ class Oqs::HomeController < BaseOqsController
left join booking_orders as bo on bo.order_id = aoi.order_id
left join bookings as bk on bk.booking_id = bo.booking_id
left join dining_facilities as df on df.id = bk.dining_facility_id")
.where("aoi.delivery_status = #{status} AND aoi.created_at >= '#{Time.now.beginning_of_day.utc}' ")
.where("aoi.delivery_status = #{status} AND aoi.created_at >= '#{Time.current.beginning_of_day.utc}' ")
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
.group("order_queue_stations.id")
end