Misc fixes from live site

This commit is contained in:
Deon George
2013-07-05 16:11:37 +10:00
parent 3499776ddc
commit f3d2c1fe8d
21 changed files with 80 additions and 65 deletions

View File

@@ -26,16 +26,19 @@ class Model_Export_Module extends ORM_OSB {
'display',
);
public function list_export() {
public function list_export($days=NULL) {
if (! is_numeric($days))
$days = 90;
$o = $this->module->module();
return $o
return $o
->select(array($this->export_item->table_name().'.date_orig','exported'))
->join($this->export_item->table_name(),'LEFT OUTER')
->on($this->export_item->table_name().'.site_id','=',$o->table_name().'.site_id') // @todo This should be automatic
->on($this->export_item->table_name().'.item_id','=',$o->table_name().'.id')
->on('export_module_id','=',$this->id)
->where($o->table_name().'.date_orig','>=',time()-86400*90)
->where($o->table_name().'.date_orig','>=',time()-86400*$days)
->find_all();
}
}