update status query to OR when there is a status filter

This commit is contained in:
Ron Rennick 2019-06-13 13:10:46 -03:00
parent e5196c8289
commit cfa913a4b8
1 changed files with 5 additions and 1 deletions

View File

@ -79,7 +79,11 @@ class WC_Admin_Reports_Orders_Data_Store extends WC_Admin_Reports_Data_Store imp
$status_subquery = $this->get_status_subquery( $query_args );
if ( $status_subquery ) {
$sql_query_params['where_clause'] .= " AND {$status_subquery}";
if ( empty( $query_args['status_is'] ) && empty( $query_args['status_is_not'] ) ) {
$sql_query_params['where_clause'] .= " AND {$status_subquery}";
} else {
$where_subquery[] = $status_subquery;
}
}
if ( $query_args['customer_type'] ) {