From: Steve Sutton Date: Mon, 14 May 2018 18:08:56 +0000 (-0400) Subject: Update sql for NOT IN in the correct place. X-Git-Tag: v1.6.83^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=b580b5650ed58d73f1f7b55526b5c0177dab3788;p=WP-Plugins%2Fglm-member-db-events.git Update sql for NOT IN in the correct place. Placing NOT IN outside sub select. --- 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";