From ee5be6fd8d1e460c27137e8c440dc1a487f69f17 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 15 Mar 2018 11:43:51 -0400 Subject: [PATCH] Update databastract for accounts Add method for getting simple account list. --- classes/data/dataAccounts.php | 25 +++++++++++++++++++++++++ models/admin/billing/index.php | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/classes/data/dataAccounts.php b/classes/data/dataAccounts.php index df0b4cf..007c79e 100644 --- a/classes/data/dataAccounts.php +++ b/classes/data/dataAccounts.php @@ -283,4 +283,29 @@ class GlmDataAccounts extends GlmDataAbstract return $r; } + public function getSimpleAccountList( + $where = '', + $order = '', + $fieldVals = true, + $idField = 'id', + $start = false, + $limit = false + ) { + // Save the current fields array and make a copy + $fSave = $this->fields; + + // Remove what we don't want from the copy and get the list + $this->fields = array( + 'id' => $fSave['id'], + 'name' => $fSave['ref_name'], + ); + + $memberList = $this->getList($where, $order, $fieldVals, $idField, $start, $limit); + + // Restore the fields list + $this->fields = $fSave; + + return $memberList; + } + } diff --git a/models/admin/billing/index.php b/models/admin/billing/index.php index 46cc37e..3f0102e 100644 --- a/models/admin/billing/index.php +++ b/models/admin/billing/index.php @@ -253,7 +253,7 @@ class GlmMembersAdmin_billing_index extends GlmDataInvoices $view = 'invoices'; // Need to get the accounts $Accounts = new GlmDataAccounts( $this->wpdb, $this->config ); - $accounts = $Accounts->getList(); + $accounts = $Accounts->getSimpleAccountList(); $where_params = array( 'true' ); -- 2.17.1