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

@@ -117,11 +117,11 @@ class ProjectTask extends AbstractModel
if ($this->parent_id > 0) {
$this->attributes['sub_num'] = 0;
$this->attributes['sub_complete'] = 0;
$this->attributes['percent'] = 0;
$this->attributes['percent'] = $this->complete_at ? 100 : 0;
return;
}
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_complete'] = $builder->whereNotNull('complete_at')->count();
//