Updating how to get the lead entry records for the csv file
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 25 Jul 2016 12:15:45 +0000 (08:15 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 25 Jul 2016 12:15:45 +0000 (08:15 -0400)
To not get timeouts or memory errors use direct wordpress query instead
of the DataAbstract method to get the list.

models/admin/leads/index.php

index 9be36b5..17cf5b7 100644 (file)
@@ -323,7 +323,12 @@ class GlmMembersAdmin_leads_index extends GlmDataLeadEntry
 
                 switch ( $option ) {
                 case 'csv':
-                    $leads = $this->getList( $where, $order );
+                    $sql = "
+                      SELECT T.*
+                        FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "lead_entry T
+                       WHERE $where
+                    ORDER BY $order";
+                    $leads = $this->wpdb->get_results( $sql, ARRAY_A );
                     break;
                 default:
                     $listResult = $this->getSimpleEntriesList( $where, $order, true, 'id', $start, $limit );