| @@ 5-11 (lines=7) @@ | ||
| 2 | ||
| 3 | class DBStaticUnit { |
|
| 4 | ||
| 5 | public static function db_unit_time_restrictions($date = SN_TIME_NOW) { |
|
| 6 | $date = is_numeric($date) ? "FROM_UNIXTIME({$date})" : "'{$date}'"; |
|
| 7 | ||
| 8 | return |
|
| 9 | "(unit_time_start IS NULL OR unit_time_start <= {$date}) AND |
|
| 10 | (unit_time_finish IS NULL OR unit_time_finish = '1970-01-01 03:00:00' OR unit_time_finish >= {$date})"; |
|
| 11 | } |
|
| 12 | ||
| 13 | public static function db_unit_by_id($unit_id, $for_update = false, $fields = '*') { |
|
| 14 | return classSupernova::db_get_unit_by_id($unit_id, $for_update, $fields); |
|
| @@ 753-759 (lines=7) @@ | ||
| 750 | ||
| 751 | ||
| 752 | ||
| 753 | public static function db_unit_time_restrictions($date = SN_TIME_NOW) |
|
| 754 | { |
|
| 755 | $date = is_numeric($date) ? "FROM_UNIXTIME({$date})" : "'{$date}'"; |
|
| 756 | return |
|
| 757 | "(unit_time_start IS NULL OR unit_time_start <= {$date}) AND |
|
| 758 | (unit_time_finish IS NULL OR unit_time_finish = '1970-01-01 03:00:00' OR unit_time_finish >= {$date})"; |
|
| 759 | } |
|
| 760 | public static function db_get_unit_by_id($unit_id, $for_update = false, $fields = '*') |
|
| 761 | { |
|
| 762 | // TODO запихивать в $data[LOC_LOCATION][$location_type][$location_id] |
|