no message

This commit is contained in:
kuaifan 2021-06-09 15:32:33 +08:00
parent dd3df81c63
commit 917d144484
2 changed files with 3 additions and 3 deletions

View File

@ -621,7 +621,7 @@ class ProjectController extends AbstractController
return Base::retError('项目不存在或不在成员列表内'); return Base::retError('项目不存在或不在成员列表内');
} }
// //
$data = ProjectTask::with(['taskUser', 'taskTag'])->where('parent_id', $task->id)->get(); $data = ProjectTask::with(['taskUser', 'taskTag'])->where('parent_id', $task->id)->whereNull('archived_at')->get();
return Base::retSuccess('success', $data); return Base::retSuccess('success', $data);
} }

View File

@ -117,11 +117,11 @@ class ProjectTask extends AbstractModel
if ($this->parent_id > 0) { if ($this->parent_id > 0) {
$this->attributes['sub_num'] = 0; $this->attributes['sub_num'] = 0;
$this->attributes['sub_complete'] = 0; $this->attributes['sub_complete'] = 0;
$this->attributes['percent'] = 0; $this->attributes['percent'] = $this->complete_at ? 100 : 0;
return; return;
} }
if (!isset($this->attributes['sub_num'])) { if (!isset($this->attributes['sub_num'])) {
$builder = self::whereParentId($this->id); $builder = self::whereParentId($this->id)->whereNull('archived_at');
$this->attributes['sub_num'] = $builder->count(); $this->attributes['sub_num'] = $builder->count();
$this->attributes['sub_complete'] = $builder->whereNotNull('complete_at')->count(); $this->attributes['sub_complete'] = $builder->whereNotNull('complete_at')->count();
// //