commission report

This commit is contained in:
Zin Lin Phyo
2017-08-29 18:36:46 +06:30
parent 63d97cce26
commit f03d8654e7
15 changed files with 412 additions and 773 deletions

View File

@@ -23,7 +23,7 @@ class Promotion < ApplicationRecord
end
def self.is_between_promo_datetime(current_day,current_time) #database is not local time
promoList = Promotion.where("(TO_CHAR(promo_start_date, 'YYYY-MM-DD') <=? AND TO_CHAR(promo_end_date, 'YYYY-MM-DD') >=?) AND (promo_start_hour < ? AND promo_end_hour > ?)", current_day, current_day, current_time, current_time)
promoList = Promotion.where("(date_format(promo_start_date, 'YYYY-MM-DD') <=? AND date_format(promo_end_date, 'YYYY-MM-DD') >=?) AND (promo_start_hour < ? AND promo_end_hour > ?)", current_day, current_day, current_time, current_time)
return promoList
end