commit 2654a6022cc88eb6a2bb169fcf0445a0832382b1
parent 1e79446e902c24f5660eaba309633e3fc59e78fe
Author: felicitus <felicitus@felicitus.org>
Date: Tue, 3 Jan 2012 21:01:43 +0100
Possible fix for PGSQL8
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/PartUnit/PartUnitManager.php b/src/backend/de/RaumZeitLabor/PartKeepr/PartUnit/PartUnitManager.php
@@ -98,7 +98,7 @@ class PartUnitManager extends Singleton {
}
public function getUnitCounts () {
- $dql = 'SELECT SUM(p.stockLevel) AS stockLevel, pu FROM de\RaumZeitLabor\PartKeepr\Part\PartUnit pu LEFT JOIN pu.parts p GROUP BY pu.id';
+ $dql = 'SELECT SUM(p.stockLevel) AS stockLevel, pu.id AS puid FROM de\RaumZeitLabor\PartKeepr\Part\PartUnit pu LEFT JOIN pu.parts p GROUP BY pu.id';
$result = PartKeepr::getEM()->createQuery($dql)->getResult();
diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/Statistic/StatisticService.php b/src/backend/de/RaumZeitLabor/PartKeepr/Statistic/StatisticService.php
@@ -1,5 +1,7 @@
<?php
namespace de\RaumZeitLabor\PartKeepr\Statistic;
+use de\RaumZeitLabor\PartKeepr\Part\PartUnit;
+
declare(encoding = 'UTF-8');
use de\RaumZeitLabor\PartKeepr\Service\Service;
@@ -25,7 +27,7 @@ class StatisticService extends Service {
foreach ($result as $row) {
$aUnits[] = array(
- "name" => $row[0]->getName(),
+ "name" => PartUnit::loadById($row["puid"])->getName(),
"stockLevel" => $row["stockLevel"]);
}