Automattic\WooCommerce\Internal\Admin\Reports
HposLegacyOrderReportQueryBuilder::build_parent_order_status_where_clause
Build the WHERE fragment that filters by the parent order's status.
Метод класса: HposLegacyOrderReportQueryBuilder{}
Хуков нет.
Возвращает
string. WHERE fragment.
Использование
// private - только в коде основоного (родительского) класса $result = $this->build_parent_order_status_where_clause( $parent_order_status, $order_status );
- $parent_order_status(массив) (обязательный)
- Status slugs without
wc-prefix. - $order_status(массив|false) (обязательный)
- If non-empty, parent-status NULL is allowed.
Код HposLegacyOrderReportQueryBuilder::build_parent_order_status_where_clause() HposLegacyOrderReportQueryBuilder::build parent order status where clause WC 11.2.2
private function build_parent_order_status_where_clause( $parent_order_status, $order_status ) {
$statuses_in = "'wc-" . implode( "','wc-", $parent_order_status ) . "'";
if ( ! empty( $order_status ) ) {
return " AND ( parent_orders.status IN ( {$statuses_in} ) OR parent_orders.id IS NULL ) ";
}
return " AND parent_orders.status IN ( {$statuses_in} ) ";
}