mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-15 05:00:49 +08:00
fix carbon addDays
This commit is contained in:
@@ -223,7 +223,7 @@ class Exam extends NexusModel
|
||||
return Carbon::parse($this->end);
|
||||
}
|
||||
if (!empty($this->duration)) {
|
||||
return $this->getBeginForUser()->clone()->addDays($this->duration);
|
||||
return $this->getBeginForUser()->clone()->addDays((int)$this->duration);
|
||||
}
|
||||
if (!empty($this->recurring)) {
|
||||
return $this->getRecurringEnd(Carbon::now());
|
||||
|
||||
@@ -104,7 +104,7 @@ class ExamUser extends NexusModel
|
||||
$duration = $exam->duration;
|
||||
if ($duration > 0) {
|
||||
do_log(sprintf('examUser: %s, end from self created_at + exam(%s) created_at: %s + %s days', $this->id, $exam->id, $this->getRawOriginal('created_at'), $duration));
|
||||
return $this->created_at->addDays($duration)->toDateTimeString();
|
||||
return $this->created_at->addDays((int)$duration)->toDateTimeString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user