fixed a mysql 5.7 introduced sql_mode issue

Change-Id: I2af85d12d2bffaaecb340900b77b64cde3a2fab3
Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
SJ 2016-12-15 11:07:36 +01:00
parent 914929552c
commit 95b906fa3f

View File

@ -39,8 +39,8 @@ class ModelAccountingAccounting extends Model
$return['stoptimestamp'] = $stop; $return['stoptimestamp'] = $stop;
// run query to return all messages // run query to return all messages
$tousers = $this->db->query('SELECT `sent`-(`sent`%86400) as `day`,`to`,count(*) as `count`,sum(`size`) as `size` FROM ' . VIEW_MESSAGES . ' WHERE `sent` >= '.$start.' AND `sent` < '.$stop.' GROUP BY FROM_UNIXTIME(`day`, "%Y.%m.%d."), `to`;'); $tousers = $this->db->query('SELECT ANY_VALUE(`sent`-(`sent`%86400)) as `day`,`to`,count(*) as `count`,sum(`size`) as `size` FROM ' . VIEW_MESSAGES . ' WHERE `sent` >= '.$start.' AND `sent` < '.$stop.' GROUP BY FROM_UNIXTIME(`day`, "%Y.%m.%d."), `to`;');
$fromusers = $this->db->query('SELECT `sent`-(`sent`%86400) as `day`,`from`,count(*) as `count`,sum(`size`) as `size` FROM ' . VIEW_MESSAGES . ' WHERE `sent` >= '.$start.' AND `sent` < '.$stop.' GROUP BY FROM_UNIXTIME(`day`, "%Y.%m.%d."), `from`;'); $fromusers = $this->db->query('SELECT ANY_VALUE(`sent`-(`sent`%86400)) as `day`,ANY_VALUE(`from`),count(*) as `count`,sum(`size`) as `size` FROM ' . VIEW_MESSAGES . ' WHERE `sent` >= '.$start.' AND `sent` < '.$stop.' GROUP BY FROM_UNIXTIME(`day`, "%Y.%m.%d."), `from`;');
// process results from above four queries // process results from above four queries
if($tousers->num_rows > 0) if($tousers->num_rows > 0)