From 10b71fc51c8ced92ced5cc67bc6b8b3ffea1beec Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 11 Aug 2017 14:40:56 -0400 Subject: [PATCH] Updating member list and export query. This is to correct the category sub query to include the status of the member info record. --- models/admin/ajax/membersListExport.php | 9 +++++---- models/admin/members/list.php | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/models/admin/ajax/membersListExport.php b/models/admin/ajax/membersListExport.php index 8ffab3ac..012f0397 100644 --- a/models/admin/ajax/membersListExport.php +++ b/models/admin/ajax/membersListExport.php @@ -126,17 +126,16 @@ class GlmMembersAdmin_ajax_membersListExport extends GlmDataMemberInfo ); // Only return information records that are active - $where .= " AND status = ".$this->config['status_numb']['Active']; // Check if this is a request to show archived members if (isset($_REQUEST['filterArchived'])) { - $where .= " AND access = ".$this->config['access_numb']['Archived']; + $where .= " AND T.status = ".$this->config['access_numb']['Archived']; $filterArchived = true; $haveFilter = true; // If not, don't show them } else { -// $where .= " AND access != ".$this->config['access_numb']['Archived']; + $where .= " AND T.status = ".$this->config['status_numb']['Active']; } // Check for a text search @@ -164,11 +163,12 @@ class GlmMembersAdmin_ajax_membersListExport extends GlmDataMemberInfo } $where .= " AND T.id in ( - SELECT DISTINCT(I.member) + SELECT DISTINCT(I.id) FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info I, ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info M, ".GLM_MEMBERS_PLUGIN_DB_PREFIX."categories C WHERE I.id = M.member_info + AND I.status = " . ( isset( $_REQUEST['filterArchived'] ) ? $this->config['status_numb']['Archived']: $this->config['status_numb']['Active'] )." AND ( M.category in ($cats) OR (C.parent in ($cats) AND M.category = C.id) @@ -217,6 +217,7 @@ class GlmMembersAdmin_ajax_membersListExport extends GlmDataMemberInfo $category_data = $this->wpdb->get_results( $sql, ARRAY_A ); //echo '
$category_data: ' . print_r( $category_data, true ) . '
'; + //echo '
$where: ' . print_r( $where, true ) . '
'; // Get a current list of members without paging $list = $this->getList($where, "member_name"); //echo '
$list: ' . print_r( $list, true ) . '
'; diff --git a/models/admin/members/list.php b/models/admin/members/list.php index d7c04db7..32c00aa1 100644 --- a/models/admin/members/list.php +++ b/models/admin/members/list.php @@ -185,6 +185,7 @@ class GlmMembersAdmin_members_list extends GlmDataMembers ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info M, ".GLM_MEMBERS_PLUGIN_DB_PREFIX."categories C WHERE I.id = M.member_info + AND I.status != " . $this->config['status_numb']['Archived'] ." AND ( M.category in ($cats) OR (C.parent in ($cats) AND M.category = C.id) -- 2.17.1