WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

DataStore::get_customer_subquery() protected WC 1.0

Returns customer subquery to be used in WHERE SQL query, based on query arguments from the user.

{} It's a method of the class: DataStore{}

No Hooks.

Return

String. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_customer_subquery( $query_args );
$query_args(array) (required)
Parameters supplied by the user.

Code of DataStore::get_customer_subquery() WC 5.3.0

<?php
protected function get_customer_subquery( $query_args ) {
	global $wpdb;

	$customer_filter = '';
	if ( isset( $query_args['customer_type'] ) ) {
		if ( 'new' === strtolower( $query_args['customer_type'] ) ) {
			$customer_filter = " {$wpdb->prefix}wc_order_stats.returning_customer = 0";
		} elseif ( 'returning' === strtolower( $query_args['customer_type'] ) ) {
			$customer_filter = " {$wpdb->prefix}wc_order_stats.returning_customer = 1";
		}
	}

	return $customer_filter;
}