Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 383-393 (lines=11) @@
380
			$args['post_status'] = 'any';
381
		}
382
383
		if ( ! empty( $request['customer'] ) ) {
384
			if ( ! empty( $args['meta_query'] ) ) {
385
				$args['meta_query'] = array();
386
			}
387
388
			$args['meta_query'][] = array(
389
				'key'   => '_customer_user',
390
				'value' => $request['customer'],
391
				'type'  => 'NUMERIC',
392
			);
393
		}
394
395
		if ( ! empty( $request['product'] ) ) {
396
			$order_ids = $wpdb->get_col( $wpdb->prepare( "

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

@@ 700-710 (lines=11) @@
697
		}
698
699
		// Filter by specific sku
700
		if ( ! empty( $args['sku'] ) ) {
701
			if ( ! is_array( $query_args['meta_query'] ) ) {
702
				$query_args['meta_query'] = array();
703
			}
704
705
			$query_args['meta_query'][] = array(
706
				'key'     => '_sku',
707
				'value'   => $args['sku'],
708
				'compare' => '='
709
			);
710
		}
711
712
		return $query_args;
713
	}