Fixed problem when trying to calculate transaction stats. The current solution is a bit dodgy, but by limiting the queries to LedgerEntry and StatementEntry, it works without too much extra effort.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@424 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -490,7 +490,12 @@ class Transaction extends AppModel {
|
|||||||
$query['fields'] = array();
|
$query['fields'] = array();
|
||||||
|
|
||||||
$stats = array();
|
$stats = array();
|
||||||
foreach (array_keys($this->hasMany) AS $table) {
|
foreach ($this->hasMany AS $table => $association) {
|
||||||
|
// Only calculate stats for *Entry types
|
||||||
|
if (!preg_match("/Entry$/", $table) &&
|
||||||
|
!preg_match("/Entry$/", $association['className']))
|
||||||
|
continue;
|
||||||
|
|
||||||
$squery = $query;
|
$squery = $query;
|
||||||
$squery['link'][$table] = array('fields' => array());
|
$squery['link'][$table] = array('fields' => array());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user