update: more feature

This commit is contained in:
tokumeikoi
2022-10-12 01:35:07 +08:00
parent 56ea13ea3b
commit 4a9e1a14af
12 changed files with 86 additions and 53 deletions

View File

@ -46,7 +46,13 @@ class StatController extends Controller
'last_month_income' => Order::where('created_at', '>=', strtotime('-1 month', strtotime(date('Y-m-1'))))
->where('created_at', '<', strtotime(date('Y-m-1')))
->whereNotIn('status', [0, 2])
->sum('total_amount')
->sum('total_amount'),
'commission_month_payout' => Order::where('commission_balance' ,'!=', NULL)
->where('created_at', '<', time())
->sum('commission_balance'),
'commission_last_month_payout' => Order::where('commission_balance' ,'!=', NULL)
->where('created_at', '<', strtotime(date('Y-m-1')))
->sum('commission_balance'),
]
]);
}