[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16823]
From: |
nelson . guerra |
Subject: |
[Fmsystem-commits] [16823] |
Date: |
Thu, 1 Jun 2017 22:03:11 -0400 (EDT) |
Revision: 16823
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16823
Author: nelson224
Date: 2017-06-01 22:03:11 -0400 (Thu, 01 Jun 2017)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind-2/property/inc/class.soreport.inc.php
Modified: branches/dev-syncromind-2/property/inc/class.soreport.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.soreport.inc.php
2017-06-02 02:02:54 UTC (rev 16822)
+++ branches/dev-syncromind-2/property/inc/class.soreport.inc.php
2017-06-02 02:03:11 UTC (rev 16823)
@@ -364,14 +364,23 @@
$string_columns = implode(',', $jsonB['columns']);
+ $array_order = array();
$group = implode(',', $jsonB['group']);
+ if ($group)
+ {
+ $array_order[] = $group.' ASC';
+ }
$order = implode(',', $jsonB['order']);
- $ordering = 'ORDER BY '.$group.' ASC';
- if (($group != $order) && $order != '')
+ if ($order)
{
- $ordering = $ordering.', '.$order.' ASC';
+ $array_order[] = $order.' ASC';
}
-
+
+ if (count($array_order))
+ {
+ $ordering = 'ORDER BY '.implode(', ',
array_unique($array_order));
+ }
+
$cond = $this->_build_conditions($jsonB['criteria'],
$id);
if ($cond)
@@ -398,6 +407,8 @@
while ($this->db->next_record())
{
+ $_group = ($group) ? $this->db->f($group) :
'grupo';
+
$value = array();
foreach ($columns as $column)
{
@@ -408,17 +419,17 @@
{
if ($v == 'sum')
{
-
$array_sum[$this->db->f($group)][$k][] = $this->db->f($k);
+ $array_sum[$_group][$k][] =
$this->db->f($k);
}
if ($v == 'count')
{
-
$array_count[$this->db->f($group)][$k][] = $this->db->f($k);
+ $array_count[$_group][$k][] =
$this->db->f($k);
}
}
- $values[$this->db->f($group)][] = $value;
+ $values[$_group][] = $value;
}
-
+
if (count($values))
{
$result = $this->_generate_total_sum($values,
$array_sum, $array_count);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16823],
nelson . guerra <=