summaryrefslogtreecommitdiffstats
path: root/application/models/EventMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/EventMapper.php')
-rwxr-xr-xapplication/models/EventMapper.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/application/models/EventMapper.php b/application/models/EventMapper.php
index d4f6b5c..9545380 100755
--- a/application/models/EventMapper.php
+++ b/application/models/EventMapper.php
@@ -267,7 +267,7 @@ class Application_Model_EventMapper
$select = $this->getDbTable()->select()
->setIntegrityCheck(false)
->from(array('pce' => 'poolctrl_event'),
- array('count1' => 'SUM(IF(pce.running=1,1,0))', 'count0' => 'SUM(IF(pce.running=1,0,1))')
+ array('not_over' => 'SUM(pce.running = 1 OR pce.running = 0)', 'over' => 'SUM(pce.running = 2 OR pce.running = 3)')
)
->join(array('pcec' => 'poolctrl_eventcategory'),
'pce.category = pcec.eventcategoryID',
@@ -277,7 +277,7 @@ class Application_Model_EventMapper
$select = $this->getDbTable()->select()
->setIntegrityCheck(false)
->from(array('pce' => 'poolctrl_event'),
- array('over' => 'SUM(IF(pce.running=1,1,0))', 'not_over' => 'SUM(IF(pce.running=1,0,1))')
+ array('not_over' => 'SUM(pce.running = 1 OR pce.running = 0)', 'over' => 'SUM(pce.running = 2 OR pce.running = 3)')
)
->join(array('pcec' => 'poolctrl_eventcategory'),
'pce.category = pcec.eventcategoryID',
@@ -288,8 +288,8 @@ class Application_Model_EventMapper
$result = $stmt->fetchAll(PDO::FETCH_NUM);
foreach ($result as $r) {
- $ret1 = array((int)$r[0],'over');
- $ret2 = array((int)$r[1],'not over');
+ $ret1 = array((int)$r[0],'not over');
+ $ret2 = array((int)$r[1],'over');
$return[] = array($ret1,$ret2);
}