WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

DataStore::add_order_status_clause() protected WC 1.0

Add order status SQL clauses if included in query.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->add_order_status_clause( $query_args, $table_name, $sql_query );
$query_args(array) (required) (passed by reference — &)
Parameters supplied by the user.
$table_name(string) (required) (passed by reference — &)
Database table name.
$sql_query(SqlQuery) (required) (passed by reference — &)
Query object.

Code of DataStore::add_order_status_clause() WC 5.3.0

<?php
protected function add_order_status_clause( $query_args, $table_name, &$sql_query ) {
	global $wpdb;
	$order_status_filter = $this->get_status_subquery( $query_args );
	if ( $order_status_filter ) {
		$sql_query->add_sql_clause( 'join', "JOIN {$wpdb->prefix}wc_order_stats ON {$table_name}.order_id = {$wpdb->prefix}wc_order_stats.order_id" );
		$sql_query->add_sql_clause( 'where', "AND ( {$order_status_filter} )" );
	}
}