* fix errors.

This commit is contained in:
wyd621
2014-04-04 03:20:37 +00:00
parent 60002b6458
commit ad56722808
10 changed files with 14 additions and 9 deletions
+3 -2
View File
@@ -240,16 +240,17 @@ class actionModel extends model
}
foreach($typeTrashes as $objectType => $objectIds)
{
if(!isset($this->config->objectTables[$objectType]))continue;
$objectIds = array_unique($objectIds);
$table = $this->config->objectTables[$objectType];
$field = $this->config->action->objectNameFields[$objectType];
if(!$table) continue;
$objectNames[$objectType] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs();
}
/* Add name field to the trashes. */
foreach($trashes as $trash) $trash->objectName = $objectNames[$trash->objectType][$trash->objectID];
foreach($trashes as $trash) $trash->objectName = isset($objectNames[$trash->objectType][$trash->objectID]) ? $objectNames[$trash->objectType][$trash->objectID] : '';
return $trashes;
}