Update databastract for accounts
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 15 Mar 2018 15:43:51 +0000 (11:43 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 15 Mar 2018 15:43:51 +0000 (11:43 -0400)
Add method for getting simple account list.

classes/data/dataAccounts.php
models/admin/billing/index.php

index df0b4cf..007c79e 100644 (file)
@@ -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;
+    }
+
 }
index 46cc37e..3f0102e 100644 (file)
@@ -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' );