$queryBuilder->innerJoin( $subscribersTable, $wpdb->postmeta, 'postmeta', "postmeta.meta_key = '_customer_user' AND $subscribersTable.wp_user_id=postmeta.meta_value" )->innerJoin( 'postmeta', $wpdb->posts, 'posts', "postmeta.post_id = posts.id AND posts.post_type = 'shop_subscription' AND posts.post_status IN('wc-active', 'wc-pending-cancel')" ); } private function applyOrderItemsJoin(QueryBuilder $queryBuilder): QueryBuilder { global $wpdb; if ($this->woocommerceHelper->isWooCommerceCustomOrdersTableEnabled()) { return $queryBuilder->innerJoin( 'wc_orders', $wpdb->prefix . 'woocommerce_order_items', 'items', "wc_orders.id = items.order_id AND order_item_type = 'line_item'" ); } return $queryBuilder->innerJoin( 'postmeta', $wpdb->prefix . 'woocommerce_order_items', 'items', "postmeta.post_id = items.order_id AND order_item_type = 'line_item'" ); } private function applyOrderItemmetaJoin(QueryBuilder $queryBuilder): QueryBuilder { global $wpdb; return $queryBuilder->innerJoin( 'items', $wpdb->prefix . 'woocommerce_order_itemmeta', 'itemmeta', "itemmeta.order_item_id=items.order_item_id AND itemmeta.meta_key='_product_id'" ); } public function getLookupData(DynamicSegmentFilterData $filterData): array { return []; } }