fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [17063] property: sql-filter on poject_id, cast as te


From: sigurdne
Subject: [Fmsystem-commits] [17063] property: sql-filter on poject_id, cast as text
Date: Tue, 12 Sep 2017 05:30:02 -0400 (EDT)

Revision: 17063
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17063
Author:   sigurdne
Date:     2017-09-12 05:30:01 -0400 (Tue, 12 Sep 2017)
Log Message:
-----------
property: sql-filter on poject_id, cast as text

Modified Paths:
--------------
    trunk/property/inc/class.soproject.inc.php

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2017-09-12 09:05:07 UTC (rev 
17062)
+++ trunk/property/inc/class.soproject.inc.php  2017-09-12 09:30:01 UTC (rev 
17063)
@@ -657,16 +657,26 @@
                                        }
                                        else
                                        {
-                                               if ($criteria[0]['type'] == int)
+                                               if ($criteria[0]['type'] == 
'int')
                                                {
                                                        $_query = (int)$query;
+
+                                                       
if($criteria[0]['matchtype'] == 'like')
+                                                       {
+                                                               // as text
+                                                               $querymethod = 
"{$where} cast({$criteria[0]['field']} as text) 
{$matchtypes[$criteria[0]['matchtype']]} 
{$criteria[0]['front']}{$_query}{$criteria[0]['back']}";
+                                                       }
+                                                       else
+                                                       {
+                                                               $querymethod = 
"{$where} {$criteria[0]['field']} {$matchtypes[$criteria[0]['matchtype']]} 
{$criteria[0]['front']}{$_query}{$criteria[0]['back']}";
+                                                       }
                                                }
                                                else
                                                {
                                                        $_query = $query;
+                                                       $querymethod = 
"{$where} {$criteria[0]['field']} {$matchtypes[$criteria[0]['matchtype']]} 
{$criteria[0]['front']}{$_query}{$criteria[0]['back']}";
                                                }
 
-                                               $querymethod = "{$where} 
{$criteria[0]['field']} {$matchtypes[$criteria[0]['matchtype']]} 
{$criteria[0]['front']}{$_query}{$criteria[0]['back']}";
                                        }
                                }
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]