fixing bug relating to the list admin model
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 21 Nov 2017 21:40:57 +0000 (16:40 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 21 Nov 2017 21:40:57 +0000 (16:40 -0500)
fixing where clause declaration in the admin view model

models/admin/forSale/index.php

index a8c1274..993e829 100644 (file)
@@ -105,7 +105,7 @@ class GlmMembersAdmin_forSale_index extends GlmDataForSale
         $isModerated         = false;
         $memberID            = false;
         $haveMember          = false;
-        $where               = 'TRUE';
+        $where               = ' TRUE ';
 
         $isPending  = ( !empty( $_REQUEST['pending-item'] ) ) ? true : false;
         $textSearch = ( !empty( $_REQUEST['text-search'] ) ) ? filter_var($_REQUEST['text-search'], FILTER_SANITIZE_STRING) : false;
@@ -183,9 +183,8 @@ class GlmMembersAdmin_forSale_index extends GlmDataForSale
         }
         if($isPending){
             $where .= ' AND active = 0 ';
-        }
-        if($textSearch){
-            $where .= " AND title LIKE '%$textSearch%'";
+        } else if($textSearch){
+            $where .= " AND title LIKE '%$textSearch%' ";
         }
         $item_data = $this->getList($where,'topic DESC, title');
         switch ($option) {