Site Status and Room numbers implemented
This commit is contained in:
@@ -175,5 +175,20 @@ abstract class ORM extends lnApp_ORM {
|
||||
|
||||
return $this->where($aid,'IN',$ao->RTM->customers($ao->RTM));
|
||||
}
|
||||
|
||||
public function where_startstop($date,$date_end,$start='date_start',$stop='date_stop') {
|
||||
if (array_key_exists('priority',$this->table_columns()))
|
||||
$this->order_by('priority','ASC');
|
||||
|
||||
return $this
|
||||
->where_open()
|
||||
->where_open()->where($start,'<=',$date)->and_where($stop,'>=',$date)->where_close()
|
||||
->or_where_open()->where($start,'<=',$date_end)->and_where($stop,'>=',$date_end)->where_close()
|
||||
->or_where_open()->where($start,'is',NULL)->where_open()->where($stop,'is',NULL)->or_where($stop,'>=',$date)->where_close()->where_close()
|
||||
->or_where_open()->where($stop,'is',NULL)->where_open()->where($start,'is',NULL)->or_where($start,'<=',$date_end)->where_close()->where_close()
|
||||
->where_close()
|
||||
->order_by($start,'ASC')
|
||||
->order_by($stop,'ASC');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user