mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-27 15:50:43 +00:00
perf: 任务时间修改提醒
This commit is contained in:
parent
ffafe82e43
commit
fd22cd3265
@ -767,9 +767,7 @@ class ProjectTask extends AbstractModel
|
|||||||
$this->addLog("修改{任务}时间" . ($desc ? "(备注:{$desc})" : ""), [
|
$this->addLog("修改{任务}时间" . ($desc ? "(备注:{$desc})" : ""), [
|
||||||
'change' => [$oldStringAt, $newStringAt]
|
'change' => [$oldStringAt, $newStringAt]
|
||||||
]);
|
]);
|
||||||
|
$this->taskPush(null, 3);
|
||||||
// 修改计划时间需要重置任务邮件提醒日志
|
|
||||||
ProjectTaskMailLog::whereTaskId($this->id)->delete();
|
|
||||||
}
|
}
|
||||||
// 以下紧顶级任务可修改
|
// 以下紧顶级任务可修改
|
||||||
if ($this->parent_id === 0) {
|
if ($this->parent_id === 0) {
|
||||||
@ -1435,7 +1433,7 @@ class ProjectTask extends AbstractModel
|
|||||||
/**
|
/**
|
||||||
* 任务提醒
|
* 任务提醒
|
||||||
* @param $userids
|
* @param $userids
|
||||||
* @param int $type 0-新任务、1-即将超时、2-已超时
|
* @param int $type 0-新任务、1-即将超时、2-已超时、3-修改时间
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function taskPush($userids, int $type)
|
public function taskPush($userids, int $type)
|
||||||
@ -1457,7 +1455,7 @@ class ProjectTask extends AbstractModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
$text = view('push.task', [
|
$text = view('push.task', [
|
||||||
'type' => str_replace([0, 1, 2], ['start', 'before', 'after'], $type),
|
'type' => str_replace([0, 1, 2, 3], ['start', 'before', 'after', 'times'], $type),
|
||||||
'task' => $this,
|
'task' => $this,
|
||||||
])->render();
|
])->render();
|
||||||
|
|
||||||
|
|||||||
@ -1,45 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* App\Models\ProjectTaskMailLog
|
|
||||||
*
|
|
||||||
* @property int $id
|
|
||||||
* @property int|null $userid 用户id
|
|
||||||
* @property int|null $task_id 任务id
|
|
||||||
* @property string|null $email 电子邮箱
|
|
||||||
* @property int|null $type 提醒类型:0 任务开始提醒,1 距离到期提醒,2到期超时提醒
|
|
||||||
* @property int|null $is_send 邮件发送是否成功:0否,1是
|
|
||||||
* @property string|null $send_error 邮件发送错误详情
|
|
||||||
* @property \Illuminate\Support\Carbon|null $created_at
|
|
||||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
|
||||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog newModelQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog newQuery()
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|ProjectTaskMailLog onlyTrashed()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereCreatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereDeletedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereEmail($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereIsSend($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereSendError($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereTaskId($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereType($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereUpdatedAt($value)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder|ProjectTaskMailLog whereUserid($value)
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|ProjectTaskMailLog withTrashed()
|
|
||||||
* @method static \Illuminate\Database\Query\Builder|ProjectTaskMailLog withoutTrashed()
|
|
||||||
* @mixin \Eloquent
|
|
||||||
*/
|
|
||||||
class ProjectTaskMailLog extends AbstractModel
|
|
||||||
{
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Tasks;
|
namespace App\Tasks;
|
||||||
|
|
||||||
use App\Models\ProjectTask;
|
|
||||||
use App\Models\ProjectTaskMailLog;
|
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Models\WebSocketDialogMsg;
|
use App\Models\WebSocketDialogMsg;
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class DeleteProjectTaskMailLogsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('project_task_mail_logs');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
// 删除表无法恢复
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,8 @@
|
|||||||
您的任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span> 即将超时,请及时处理。
|
您的任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span> 即将超时,请及时处理。
|
||||||
@elseif ($type === 'after')
|
@elseif ($type === 'after')
|
||||||
您的任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span> 已经超时,请及时处理。
|
您的任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span> 已经超时,请及时处理。
|
||||||
|
@elseif ($type === 'times')
|
||||||
|
您的任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span> 时间已修改,请注意查看。
|
||||||
@else
|
@else
|
||||||
您有一个新任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span>。
|
您有一个新任务 <span class="mention task" data-id="{{ $task->id }}">#{{ $task->name }}</span>。
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user