Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableSearchQuery::generate_where()
Generates the necessary WHERE clauses for the order search to be performed.
Метод класса: OrdersTableSearchQuery{}
Хуков нет.
Возвращает
Строку
.
Использование
// private - только в коде основоного (родительского) класса $result = $this->generate_where(): string;
Код OrdersTableSearchQuery::generate_where() OrdersTableSearchQuery::generate where WC 8.3.1
private function generate_where(): string { global $wpdb; $where = ''; $possible_order_id = (string) absint( $this->query->get( 's' ) ); $order_table = $this->query->get_table_name( 'orders' ); // Support the passing of an order ID as the search term. if ( (string) $this->query->get( 's' ) === $possible_order_id ) { $where = "`$order_table`.id = $possible_order_id OR "; } $meta_sub_query = $this->generate_where_for_meta_table(); $where .= $wpdb->prepare( " search_query_items.order_item_name LIKE %s OR `$order_table`.id IN ( $meta_sub_query ) ", $this->search_term ); return " ( $where ) "; }