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');