From 043eecedc505773ac6d57ce20177098199cef3e0 Mon Sep 17 00:00:00 2001 From: andyexeter Date: Wed, 6 Jul 2016 00:15:39 +0100 Subject: [PATCH] Add NOT IN operator to WC_Admin_Report::get_order_report_data() --- includes/admin/reports/class-wc-admin-report.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/admin/reports/class-wc-admin-report.php b/includes/admin/reports/class-wc-admin-report.php index 6b0d76cb628..fdd705a30c6 100644 --- a/includes/admin/reports/class-wc-admin-report.php +++ b/includes/admin/reports/class-wc-admin-report.php @@ -242,14 +242,14 @@ class WC_Admin_Report { $key = is_array( $value['meta_key'] ) ? $value['meta_key'][0] . '_array' : $value['meta_key']; - if ( strtolower( $value['operator'] ) == 'in' ) { + if ( strtolower( $value['operator'] ) == 'in' || strtolower( $value['operator'] ) == 'not in' ) { if ( is_array( $value['meta_value'] ) ) { $value['meta_value'] = implode( "','", $value['meta_value'] ); } if ( ! empty( $value['meta_value'] ) ) { - $where_value = "IN ('{$value['meta_value']}')"; + $where_value = "{$value['operator']} ('{$value['meta_value']}')"; } } else { $where_value = "{$value['operator']} '{$value['meta_value']}'"; @@ -289,14 +289,14 @@ class WC_Admin_Report { foreach ( $where as $value ) { - if ( strtolower( $value['operator'] ) == 'in' ) { + if ( strtolower( $value['operator'] ) == 'in' || strtolower( $value['operator'] ) == 'not in' ) { if ( is_array( $value['value'] ) ) { $value['value'] = implode( "','", $value['value'] ); } if ( ! empty( $value['value'] ) ) { - $where_value = "IN ('{$value['value']}')"; + $where_value = "{$value['operator']} ('{$value['value']}')"; } } else { $where_value = "{$value['operator']} '{$value['value']}'";