Customers report: perform a LEFT JOIN on the order stats table to include customers that have not yet placed an order.
This commit is contained in:
parent
46b503dd54
commit
d9fd8568df
|
@ -327,7 +327,7 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
|
|||
SELECT {$customers_table_name}.customer_id
|
||||
FROM
|
||||
{$customers_table_name}
|
||||
JOIN
|
||||
LEFT JOIN
|
||||
{$order_stats_table_name}
|
||||
ON
|
||||
{$customers_table_name}.customer_id = {$order_stats_table_name}.customer_id
|
||||
|
@ -354,7 +354,7 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
|
|||
{$selections}
|
||||
FROM
|
||||
{$customers_table_name}
|
||||
JOIN
|
||||
LEFT JOIN
|
||||
{$order_stats_table_name}
|
||||
ON
|
||||
{$customers_table_name}.customer_id = {$order_stats_table_name}.customer_id
|
||||
|
|
Loading…
Reference in New Issue