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:
parent
14998e07fb
commit
3e89cdc8dd
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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.";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue