1
0
Fork 0
mirror of https://github.com/Oreolek/kangana.git synced 2024-06-16 23:11:07 +03:00

Preparation fixes, test is passing now

This commit is contained in:
Alexander Yakovlev 2016-11-12 18:47:46 +07:00
parent 14998e07fb
commit 3e89cdc8dd
2 changed files with 4 additions and 3 deletions

View file

@ -137,6 +137,7 @@ class Model_Task extends ORM {
/**
* Get last sent or prepared letter and check if it's time to send another one.
* @return bool
**/
public static function check_period($client_id, $letters, $period)
{
@ -158,9 +159,7 @@ class Model_Task extends ORM {
->and_where(DB::expr('DATEDIFF(CURDATE(), `date`)'), '=', $period)
->execute()
->get('date');
if ( ! empty($check))
return TRUE;
return FALSE;
return is_null($check);
}
/**

View file

@ -47,6 +47,8 @@ class Task_Prepare extends Minion_Task
{
Model_Task::prepare($client_id, $letter);
}
} else {
echo "Letter won't be prepared because it's too early to send it.";
}
}