From 05af4949bfcf2a42ece30f1d77816a3c3018eae2 Mon Sep 17 00:00:00 2001 From: Nikita Kiselev Date: Sat, 13 Dec 2025 01:03:53 +0300 Subject: [PATCH] feat: correct stats for telecart dashboard --- .../upload/oc_telegram_shop/bastion/Handlers/StatsHandler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/StatsHandler.php b/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/StatsHandler.php index cf0feef..72af1ed 100755 --- a/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/StatsHandler.php +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/bastion/Handlers/StatsHandler.php @@ -30,6 +30,9 @@ class StatsHandler new RawExpression('SUM(orders.total) AS orders_total_amount'), ]) ->from(db_table('order'), 'orders') + ->join('telecart_customers', function (JoinClause $join) { + $join->on('orders.customer_id', '=', 'telecart_customers.oc_customer_id'); + }) ->join('telecart_order_meta', function (JoinClause $join) { $join->on('orders.order_id', '=', 'telecart_order_meta.oc_order_id') ->whereRaw('orders.store_id = telecart_order_meta.oc_store_id');