WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Orders\Stats

DataStore::get_unique_product_count() public WC 1.0

Get unique products based on user time query

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

No Hooks.

Return

Int. Unique product count.

Usage

$DataStore = new DataStore();
$DataStore->get_unique_product_count( $from_clause, $where_time_clause, $where_clause );
$from_clause(string) (required)
From clause with date query.
$where_time_clause(string) (required)
Where clause with date query.
$where_clause(string) (required)
Where clause with date query.

Code of DataStore::get_unique_product_count() WC 5.3.0

<?php
public function get_unique_product_count( $from_clause, $where_time_clause, $where_clause ) {
	global $wpdb;

	$table_name = self::get_db_table_name();
	return $wpdb->get_var(
		"SELECT
				COUNT( DISTINCT {$wpdb->prefix}wc_order_product_lookup.product_id )
			FROM
				{$wpdb->prefix}wc_order_product_lookup JOIN {$table_name} ON {$wpdb->prefix}wc_order_product_lookup.order_id = {$table_name}.order_id
				{$from_clause}
			WHERE
				1=1
				{$where_time_clause}
				{$where_clause}"
	); // phpcs:ignore cache ok, DB call ok, unprepared SQL ok.
}