From b580b5650ed58d73f1f7b55526b5c0177dab3788 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 14 May 2018 14:08:56 -0400 Subject: [PATCH] Update sql for NOT IN in the correct place. Placing NOT IN outside sub select. --- models/front/events/baseAction.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/models/front/events/baseAction.php b/models/front/events/baseAction.php index db8ead9..6e2412c 100644 --- a/models/front/events/baseAction.php +++ b/models/front/events/baseAction.php @@ -278,18 +278,17 @@ abstract class GlmMembersFront_events_baseAction extends GlmDataEvents } } else if ( $this->notInCat && !empty( $this->notInCat ) ) { $whereParts[] = " - T.id IN ( + T.id NOT IN ( SELECT event FROM " .GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "event_categories - WHERE category NOT IN (" . implode( ',', $this->notInCat ) . ") - AND event IN ( + WHERE category IN (" . implode( ',', $this->notInCat ) . ") + )"; + $whereParts[] = "T.id IN ( SELECT event FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times AS ET WHERE status = " . $this->config['status_numb']['Active'] . " AND " . $this->dateRange . " - ) - ) - "; + ) "; $order = "T.id"; if ( $limit = filter_var( $limit, FILTER_VALIDATE_INT ) ) { $order .= " LIMIT {$limit} OFFSET 0"; -- 2.17.1