fix timezone

This commit is contained in:
Thein Lin Kyaw
2023-02-10 14:50:30 +06:30
parent 944f7a7259
commit 5d9281e196
18 changed files with 54 additions and 54 deletions

View File

@@ -6,8 +6,8 @@ class Crm::DiningQueuesController < BaseCrmController
# GET /crm/dining_queues.json
def index
today = Time.current.strftime('%Y-%m-%d')
@dining_queues = DiningQueue.where("DATE_FORMAT(CONVERT_TZ(created_at,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
@complete_queue = DiningQueue.where("DATE_FORMAT(CONVERT_TZ(created_at,'+00:00', Time.zone.formatted_offset),'%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
@dining_queues = DiningQueue.where("DATE_FORMAT(CONVERT_TZ(created_at, '+00:00', '<%= Time.zone.formatted_offset %>'), '%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
@complete_queue = DiningQueue.where("DATE_FORMAT(CONVERT_TZ(created_at, '+00:00', '<%= Time.zone.formatted_offset %>'), '%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
if params[:term]
@customer = Customer.order(:name).where('lower(name) LIKE ?', "%#{params[:term].downcase}%")