fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11521] property: tuning


From: Sigurd Nes
Subject: [Fmsystem-commits] [11521] property: tuning
Date: Tue, 10 Dec 2013 14:22:26 +0000

Revision: 11521
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11521
Author:   sigurdne
Date:     2013-12-10 14:22:25 +0000 (Tue, 10 Dec 2013)
Log Message:
-----------
property: tuning

Modified Paths:
--------------
    trunk/property/inc/class.soentity.inc.php
    trunk/property/inc/class.solocation.inc.php

Modified: trunk/property/inc/class.soentity.inc.php
===================================================================
--- trunk/property/inc/class.soentity.inc.php   2013-12-10 07:41:26 UTC (rev 
11520)
+++ trunk/property/inc/class.soentity.inc.php   2013-12-10 14:22:25 UTC (rev 
11521)
@@ -1064,10 +1064,10 @@
                                $user_column_filter = '';
                                if ($_user_columns)
                                {
-                                       $user_column_filter = " OR 
($attribute_filter AND id IN (" . implode(',',$_user_columns) .'))';
+                                       $user_column_filter = " OR 
({$attribute_filter} AND id IN (" . implode(',',$_user_columns) .'))';
                                }
 
-                               $this->db->query("SELECT * FROM 
$attribute_table WHERE list=1 AND $attribute_filter $user_column_filter ORDER 
BY group_id, attrib_sort ASC");
+                               $this->db->query("SELECT * FROM 
{$attribute_table} WHERE list=1 AND {$attribute_filter} {$user_column_filter} 
ORDER BY group_id, attrib_sort ASC");
 
                                $i      = count($uicols['name']);
                                while ($this->db->next_record())

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2013-12-10 07:41:26 UTC (rev 
11520)
+++ trunk/property/inc/class.solocation.inc.php 2013-12-10 14:22:25 UTC (rev 
11521)
@@ -1180,6 +1180,9 @@
 
                function read_single($location_code='',$values = array())
                {
+                       //cache result
+                       static $location = array();
+
                        $location_array = explode('-',$location_code);
                        $type_id= count($location_array);
 
@@ -1188,6 +1191,11 @@
                                return;
                        }
 
+                       if(isset($location[$location_code]))
+                       {
+                               return $location[$location_code];
+                       }
+
                        $cols = "fm_location{$type_id}.category as cat_id";
                        $cols .= ",fm_location{$type_id}_category.descr as 
category_name";
                        $cols_return[]  = 'cat_id';
@@ -1255,6 +1263,8 @@
 
                        //_debug_array($cols_return);
                        //_debug_array($values);
+
+                       $location[$location_code] = $values;
                        return $values;
                }
 




reply via email to

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