no message

This commit is contained in:
kuaifan 2022-01-06 15:24:54 +08:00
parent 713770a448
commit 6d026bbf42
5 changed files with 17 additions and 10 deletions

View File

@ -239,6 +239,7 @@ class Project extends AbstractModel
if ($archived_at === null) { if ($archived_at === null) {
// 取消归档 // 取消归档
$this->archived_at = null; $this->archived_at = null;
$this->archived_userid = User::userid();
$this->addLog("项目取消归档"); $this->addLog("项目取消归档");
$this->pushMsg('add', $this); $this->pushMsg('add', $this);
ProjectTask::whereProjectId($this->id)->whereArchivedFollow(1)->update([ ProjectTask::whereProjectId($this->id)->whereArchivedFollow(1)->update([

View File

@ -777,6 +777,7 @@ class ProjectTask extends AbstractModel
if ($archived_at === null) { if ($archived_at === null) {
// 取消归档 // 取消归档
$this->archived_at = null; $this->archived_at = null;
$this->archived_userid = User::userid();
$this->archived_follow = 0; $this->archived_follow = 0;
$this->addLog("任务取消归档:" . $this->name); $this->addLog("任务取消归档:" . $this->name);
$this->pushMsg('add', [ $this->pushMsg('add', [

View File

@ -30,16 +30,15 @@ class AutoArchivedTask extends AbstractTask
$archivedDay = min(100, $archivedDay); $archivedDay = min(100, $archivedDay);
$archivedTime = Carbon::now()->subDays($archivedDay); $archivedTime = Carbon::now()->subDays($archivedDay);
//获取已完成未归档的任务 //获取已完成未归档的任务
AbstractModel::transaction(function() use ($archivedTime) { $taskLists = ProjectTask::whereNotNull('complete_at')
$taskLists = ProjectTask::whereNotNull('complete_at') ->where('complete_at', '<=', $archivedTime)
->where('complete_at', '<=', $archivedTime) ->where('archived_userid', 0)
->whereNull('archived_at') ->whereNull('archived_at')
->take(100) ->take(100)
->get(); ->get();
foreach ($taskLists AS $task) { foreach ($taskLists AS $task) {
$task->archivedTask(Carbon::now(), true); $task->archivedTask(Carbon::now(), true);
} }
});
} }
} }
} }

View File

@ -83,6 +83,9 @@ export default {
key: 'archived_userid', key: 'archived_userid',
minWidth: 80, minWidth: 80,
render: (h, {row}) => { render: (h, {row}) => {
if (!row.archived_userid) {
return h('Tag', this.$L('系统自动'));
}
return h('UserAvatar', { return h('UserAvatar', {
props: { props: {
userid: row.archived_userid, userid: row.archived_userid,

View File

@ -74,6 +74,9 @@ export default {
key: 'archived_userid', key: 'archived_userid',
minWidth: 100, minWidth: 100,
render: (h, {row}) => { render: (h, {row}) => {
if (!row.archived_userid) {
return h('Tag', this.$L('系统自动'));
}
return h('UserAvatar', { return h('UserAvatar', {
props: { props: {
userid: row.archived_userid, userid: row.archived_userid,