Automattic\WooCommerce\Admin\API\Reports\Coupons\Stats
Segmenter::get_segment_selections_order_level
Returns column => query mapping to be used for order-related product-level segmenting query (e.g. orders_count when segmented by category).
Метод класса: Segmenter{}
Хуков нет.
Возвращает
Массив. Column => SELECT query mapping.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_segment_selections_order_level( $coupons_lookup_table );
- $coupons_lookup_table(строка) (обязательный)
- Name of SQL table containing the order-level segmenting info.
Код Segmenter::get_segment_selections_order_level() Segmenter::get segment selections order level WC 10.7.0
protected function get_segment_selections_order_level( $coupons_lookup_table ) {
$columns_mapping = array(
'coupons_count' => "COUNT(DISTINCT $coupons_lookup_table.coupon_id) as coupons_count",
'orders_count' => "COUNT(DISTINCT $coupons_lookup_table.order_id) as orders_count",
);
return $columns_mapping;
}