PHRAS-64 #time 1h

fix "subdefs to be done" in admin/base
This commit is contained in:
Jean-Yves Gaulier
2014-09-08 11:56:54 +02:00
committed by Nicolas Le Goff
parent 752f0d5da4
commit 4441eae4a5
2 changed files with 5 additions and 7 deletions

View File

@@ -430,19 +430,14 @@ class databox extends base
$ret['thesaurus_indexed'] += $row['n'];
}
$sql = "SELECT type, jeton, COUNT(record_id) AS n FROM record WHERE jeton & ".JETON_MAKE_SUBDEF." GROUP BY type, jeton";
$sql = "SELECT type, COUNT(record_id) AS n FROM record WHERE jeton & ".JETON_MAKE_SUBDEF." GROUP BY type";
$stmt = $this->get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
foreach ($rs as $row) {
if(!array_key_exists($row['type'], $ret['jeton_subdef'])) {
$ret['jeton_subdef'][$row['type']] = 0;
}
if((int)$row['jeton'] & JETON_MAKE_SUBDEF) {
$ret['jeton_subdef'][$row['type']] += (int)$row['n'];
}
$ret['jeton_subdef'][$row['type']] = (int)$row['n'];
}
return $ret;