Fix order_count inconsistency between stats and reports (#49283)
* Fix order_count consistency between stats and reports * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
4311640de2
commit
39b8b23fc8
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Fix Order Count inconsistency between stats and reports
|
|
@ -82,7 +82,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
|
||||||
'total_tax' => 'SUM(total_tax) as total_tax',
|
'total_tax' => 'SUM(total_tax) as total_tax',
|
||||||
'order_tax' => 'SUM(order_tax) as order_tax',
|
'order_tax' => 'SUM(order_tax) as order_tax',
|
||||||
'shipping_tax' => 'SUM(shipping_tax) as shipping_tax',
|
'shipping_tax' => 'SUM(shipping_tax) as shipping_tax',
|
||||||
'orders_count' => "COUNT({$table_name}.order_id) as orders_count",
|
'orders_count' => "COUNT( DISTINCT ( CASE WHEN parent_id = 0 THEN {$table_name}.order_id END ) ) as orders_count",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue