Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Jan 6, 2022
1 parent 713770a commit 6d026bb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/Models/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ public function archivedProject($archived_at)
if ($archived_at === null) {
// 取消归档
$this->archived_at = null;
$this->archived_userid = User::userid();
$this->addLog("项目取消归档");
$this->pushMsg('add', $this);
ProjectTask::whereProjectId($this->id)->whereArchivedFollow(1)->update([
Expand Down
1 change: 1 addition & 0 deletions app/Models/ProjectTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ public function archivedTask($archived_at, $isAuto = false)
if ($archived_at === null) {
// 取消归档
$this->archived_at = null;
$this->archived_userid = User::userid();
$this->archived_follow = 0;
$this->addLog("任务取消归档:" . $this->name);
$this->pushMsg('add', [
Expand Down
19 changes: 9 additions & 10 deletions app/Tasks/AutoArchivedTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,15 @@ public function start()
$archivedDay = min(100, $archivedDay);
$archivedTime = Carbon::now()->subDays($archivedDay);
//获取已完成未归档的任务
AbstractModel::transaction(function() use ($archivedTime) {
$taskLists = ProjectTask::whereNotNull('complete_at')
->where('complete_at', '<=', $archivedTime)
->whereNull('archived_at')
->take(100)
->get();
foreach ($taskLists AS $task) {
$task->archivedTask(Carbon::now(), true);
}
});
$taskLists = ProjectTask::whereNotNull('complete_at')
->where('complete_at', '<=', $archivedTime)
->where('archived_userid', 0)
->whereNull('archived_at')
->take(100)
->get();
foreach ($taskLists AS $task) {
$task->archivedTask(Carbon::now(), true);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export default {
key: 'archived_userid',
minWidth: 80,
render: (h, {row}) => {
if (!row.archived_userid) {
return h('Tag', this.$L('系统自动'));
}
return h('UserAvatar', {
props: {
userid: row.archived_userid,
Expand Down
3 changes: 3 additions & 0 deletions resources/assets/js/pages/manage/components/TaskArchived.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default {
key: 'archived_userid',
minWidth: 100,
render: (h, {row}) => {
if (!row.archived_userid) {
return h('Tag', this.$L('系统自动'));
}
return h('UserAvatar', {
props: {
userid: row.archived_userid,
Expand Down

0 comments on commit 6d026bb

Please sign in to comment.