weizong song 3 years ago
parent ad4c295df9
commit 0eeb207103

@ -249,7 +249,9 @@ class StatisticsController extends CommonController
$checkout = $model_checkout->sum("total");
$refund = $model_refund->sum("money");
$refund_by_methods = [];
$refund_by_payment = $model_refund->select("payment", "paid_at", "money", "order_id")->addSelect(DB::raw("sum(`money`) as total"))->groupBy("payment")->get()->keyBy("payment")->toArray();
dd($refund_by_payment);
$refund_methods = (new Refund())->groupBy("payment")->get()->keyBy("payment")->toArray();
foreach ($refund_methods as $k => $refund_method) {
$refund_by_methods[$k] = $model_refund->where("payment", $k)->sum("money");

Loading…
Cancel
Save