From: Steve Sutton Date: Thu, 15 Mar 2018 15:43:51 +0000 (-0400) Subject: Update databastract for accounts X-Git-Tag: v1.0.0^2~145 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=ee5be6fd8d1e460c27137e8c440dc1a487f69f17;p=WP-Plugins%2Fglm-member-db-billing.git Update databastract for accounts Add method for getting simple account list. --- 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' );