Skip to content

Commit

Permalink
fix cron
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhelskiy committed Jan 30, 2017
1 parent 08f23d0 commit e34f7b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions classes/modules/cron/Cron.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public function RunMain()
* TODO: можно сделать выборку нужных задач сразу из БД, а не сравнивать в php время
*/
$aTasks = $this->GetTaskItemsByFilter(array(
'state' => self::TASK_STATE_ACTIVE,
'state' => self::TASK_STATE_ACTIVE,
'#where' => array(
'(t.time_start IS ? OR t.time_start <= ?)' => array(null, date('H:i')),
'(t.time_end IS ? OR t.time_end >= ?)' => array(null, date('H:i'))
'(t.time_start IS NULL OR t.time_start <= ?)' => array(date('H:i')),
'(t.time_end IS NULL OR t.time_end >= ?)' => array(date('H:i'))
)
));
$aTasksReady = array();
Expand Down
4 changes: 2 additions & 2 deletions classes/modules/cron/entity/Task.entity.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public function ValidateStateCheck($sValue, $aParams)

public function ValidateTimesCheck($sValue, $aParams)
{
if ($this->getTimeStart() == '') {
if (!$this->getTimeStart()) {
$this->setTimeStart(null);
}
if ($this->getTimeEnd() == '') {
if (!$this->getTimeEnd()) {
$this->setTimeEnd(null);
}
return true;
Expand Down

0 comments on commit e34f7b9

Please sign in to comment.