hourly sale group query

This commit is contained in:
phyusin
2017-10-27 12:04:42 +06:30
parent 6b3616f644
commit 0d2952c35f

View File

@@ -858,6 +858,7 @@ end
def self.hourly_sales(today)
query= Sale.select("grand_total")
.where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today)
.group("date_format(receipt_date, '%I %p')")
end
def self.employee_sales(today)