mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-28 12:50:48 +00:00
fix: 任务重复周期
This commit is contained in:
parent
c6402c72f9
commit
ad2b456f07
@ -770,6 +770,7 @@ class ProjectTask extends AbstractModel
|
||||
// 以下紧顶级任务可修改
|
||||
if ($this->parent_id === 0) {
|
||||
// 重复周期
|
||||
$loopAt = $this->loop_at;
|
||||
if (Arr::exists($data, 'loop')) {
|
||||
$this->loop = $data['loop'];
|
||||
if (!$this->refreshLoop()) {
|
||||
@ -779,6 +780,11 @@ class ProjectTask extends AbstractModel
|
||||
// 更新任务时间也要更新重复周期
|
||||
$this->refreshLoop();
|
||||
}
|
||||
if ($loopAt !== $this->loop_at) {
|
||||
$this->addLog("修改{任务}重复周期", [
|
||||
'change' => [$loopAt, $this->loop_at]
|
||||
]);
|
||||
}
|
||||
// 协助人员
|
||||
if (Arr::exists($data, 'assist')) {
|
||||
$array = [];
|
||||
@ -916,6 +922,7 @@ class ProjectTask extends AbstractModel
|
||||
if (Base::isNumber($this->loop)) {
|
||||
$this->loop_at = $base->addDays($this->loop);
|
||||
} else {
|
||||
$this->loop_at = null;
|
||||
$success = false;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1011,7 +1011,7 @@ class Base
|
||||
*/
|
||||
public static function isNumber($str)
|
||||
{
|
||||
if (preg_match("/^\d*$/", $str)) {
|
||||
if (preg_match("/^\d+$/", $str)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user