Customer report data store: fix handling of ‘name’ parameter in WHERE clause.

This commit is contained in:
Jeff Stieler 2018-12-20 18:55:48 -07:00
parent 714c1ee030
commit fa3379e62f
1 changed files with 4 additions and 1 deletions

View File

@ -168,7 +168,6 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
$where_clauses = array();
$exact_match_params = array(
'name',
'username',
'email',
'country',
@ -183,6 +182,10 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
}
}
if ( ! empty( $query_args['name'] ) ) {
$where_clauses[] = $wpdb->prepare( "CONCAT_WS( ' ', first_name, last_name ) = %s", $query_args['name'] );
}
$numeric_params = array(
'orders_count' => '%d',
'total_spend' => '%f',