* [task#64875,done,0.1h] check left hour.
This commit is contained in:
+9
-3
@@ -770,13 +770,18 @@ class taskZen extends task
|
||||
* 构造激活的任务数据。
|
||||
* Build the task data to activate.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param int $taskID
|
||||
* @access protected
|
||||
* @return object
|
||||
* @return object|bool
|
||||
*/
|
||||
protected function buildTaskForActivate(int $taskID): object
|
||||
protected function buildTaskForActivate(int $taskID): object|bool
|
||||
{
|
||||
$task = form::data($this->config->task->form->activate, $taskID)->add('id', $taskID)->get();
|
||||
if($task->left && $task->left < 0)
|
||||
{
|
||||
dao::$errors['left'] = sprintf($this->lang->task->error->recordMinus, $this->lang->task->left);
|
||||
return false;
|
||||
}
|
||||
unset($task->comment);
|
||||
|
||||
return $this->loadModel('file')->processImgURL($task, $this->config->task->editor->activate['id'], (string)$this->post->uid);
|
||||
@@ -1271,6 +1276,7 @@ class taskZen extends task
|
||||
if($oldTask->status == 'doing') dao::$errors[] = $this->lang->task->error->alreadyStarted;
|
||||
}
|
||||
if(!$task->left && !$task->consumed) dao::$errors['message'] = $this->lang->task->noticeTaskStart;
|
||||
if($task->left && $task->left < 0) dao::$errors['left'] = sprintf($this->lang->task->error->recordMinus, $this->lang->task->left);
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user