Code Duplication    Length = 11-11 lines in 2 locations

includes/api/class-wc-rest-orders-controller.php 1 location

@@ 393-403 (lines=11) @@
390
			$args['post_status'] = 'any';
391
		}
392
393
		if ( ! empty( $request['customer'] ) ) {
394
			if ( ! empty( $args['meta_query'] ) ) {
395
				$args['meta_query'] = array();
396
			}
397
398
			$args['meta_query'][] = array(
399
				'key'   => '_customer_user',
400
				'value' => $request['customer'],
401
				'type'  => 'NUMERIC',
402
			);
403
		}
404
405
		if ( ! empty( $request['product'] ) ) {
406
			$order_ids = $wpdb->get_col( $wpdb->prepare( "

includes/cli/class-wc-cli-product.php 1 location

@@ 707-717 (lines=11) @@
704
		}
705
706
		// Filter by specific sku
707
		if ( ! empty( $args['sku'] ) ) {
708
			if ( ! is_array( $query_args['meta_query'] ) ) {
709
				$query_args['meta_query'] = array();
710
			}
711
712
			$query_args['meta_query'][] = array(
713
				'key'     => '_sku',
714
				'value'   => $args['sku'],
715
				'compare' => '='
716
			);
717
		}
718
719
		return $query_args;
720
	}