X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_event_audit.php;h=459538ce7126b1c165a0e0681615358dc832ca2c;hb=d5b562188e4ae254d89b414aebfbef891dab2500;hp=a0eaccec943421cc23befc47d93a56e92c3feef8;hpb=a091f31cd15d6221ec1b1e670acda8e151e1e80e;p=Pman.Core diff --git a/DataObjects/Core_event_audit.php b/DataObjects/Core_event_audit.php index a0eaccec..459538ce 100644 --- a/DataObjects/Core_event_audit.php +++ b/DataObjects/Core_event_audit.php @@ -61,6 +61,7 @@ class Pman_Core_DataObjects_Core_event_audit extends DB_DataObject } function findLast($event, $name) { + //DB_DataObject::debugLevel(1); $x = DB_DataObject::factory('core_event_audit'); $x->autoJoin(); $x->selectAdd(); @@ -68,10 +69,10 @@ class Pman_Core_DataObjects_Core_event_audit extends DB_DataObject $x->name = $name; $x->whereAdd(" - Events.on_table= '{$event->on_table}' AND - Events.on_id= '{$event->on_id}' + join_event_id_id.on_table = '{$event->on_table}' AND + join_event_id_id.on_id = {$event->on_id} "); - $x->orderBy('Events.event_when DESC'); + $x->orderBy('join_event_id_id.event_when DESC'); $x->limit(1); if (!$x->find(true)) { return 0; @@ -80,6 +81,5 @@ class Pman_Core_DataObjects_Core_event_audit extends DB_DataObject } - - + } \ No newline at end of file