回答編集履歴
1
追記
test
CHANGED
@@ -3,3 +3,9 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
SaleDetail.sum(:mony)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
SaleDetail.joins(:sale).where("sales.created_at": Time.zone.now.all_day).sum(:mony)
|
10
|
+
|
11
|
+
Sale.joins(:sale_details).where(created_at: Time.zone.now.all_day).sum("sale_details.mony")
|