Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats

DataStore::assign_report_columns()protectedWC 1.0

Assign report columns once full table name has been assigned.

Method of the class: DataStore{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->assign_report_columns();

DataStore::assign_report_columns() code WC 7.3.0

protected function assign_report_columns() {
	$table_name           = self::get_db_table_name();
	$this->report_columns = array(
		'amount'        => 'SUM(discount_amount) as amount',
		'coupons_count' => 'COUNT(DISTINCT coupon_id) as coupons_count',
		'orders_count'  => "COUNT(DISTINCT {$table_name}.order_id) as orders_count",
	);
}