mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 00:41:59 +01:00
Fixed account statistics
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
7562cd49df
commit
307a84b12b
@ -36,7 +36,7 @@ class ModelAccountingAccounting extends Model {
|
||||
|
||||
// emails sent to users
|
||||
|
||||
$tousers = $this->db->query("SELECT `$column`-(`$column` % 86400) AS `day`, `to`, COUNT(*) AS `count`, SUM(`size`) AS `size` FROM " . VIEW_MESSAGES . " WHERE `$column` >= ? AND `$column` < ? GROUP BY FROM_UNIXTIME(`day`, '%Y.%m.%d.'), `to`", array($start, $stop));
|
||||
$tousers = $this->db->query("SELECT `$column`-(`$column` % 86400) AS `day`, `to`, COUNT(*) AS `count`, SUM(`size`) AS `size` FROM " . VIEW_MESSAGES . " WHERE deleted=0 AND `$column` >= ? AND `$column` < ? GROUP BY FROM_UNIXTIME(`day`, '%Y.%m.%d.'), `to`", array($start, $stop));
|
||||
|
||||
foreach($tousers->rows as $row) {
|
||||
$counter[$row['day']][$row['to']]['recd'] = $row['count'];
|
||||
@ -46,7 +46,7 @@ class ModelAccountingAccounting extends Model {
|
||||
|
||||
// emails sent from users
|
||||
|
||||
$fromusers = $this->db->query("SELECT `$column`-(`$column` % 86400) AS `day`, `from`, COUNT(*) AS `count`, SUM(`size`) AS `size` FROM " . VIEW_MESSAGES . " WHERE `$column` >= ? AND `$column` < ? GROUP BY FROM_UNIXTIME(`day`, '%Y.%m.%d.'), `from`", array($start, $stop));
|
||||
$fromusers = $this->db->query("SELECT `$column`-(`$column` % 86400) AS `day`, `from`, COUNT(*) AS `count`, SUM(`size`) AS `size` FROM " . VIEW_MESSAGES . " WHERE deleted=0 AND `$column` >= ? AND `$column` < ? GROUP BY FROM_UNIXTIME(`day`, '%Y.%m.%d.'), `from`", array($start, $stop));
|
||||
|
||||
foreach($fromusers->rows as $row) {
|
||||
$counter[$row['day']][$row['from']]['sent'] = $row['count'];
|
||||
|
Loading…
Reference in New Issue
Block a user