Automattic\WooCommerce\Admin\API\Reports
DataStore::get_customer_subquery
Returns customer subquery to be used in WHERE SQL query, based on query arguments from the user.
Метод класса: DataStore{}
Хуков нет.
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_customer_subquery( $query_args );
- $query_args(массив) (обязательный)
- Parameters supplied by the user.
Код DataStore::get_customer_subquery() DataStore::get customer subquery WC 10.8.1
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;
}