diff --git a/app/Models/ProjectTask.php b/app/Models/ProjectTask.php index 998d4fea8..3a4bea77f 100644 --- a/app/Models/ProjectTask.php +++ b/app/Models/ProjectTask.php @@ -753,6 +753,9 @@ class ProjectTask extends AbstractModel $this->addLog("修改{任务}时间", [ 'change' => [$oldStringAt, $newStringAt] ]); + + //修改计划时间需要重置任务邮件提醒日志 + ProjectTaskMailLog::whereTaskId($this->id)->delete(); } // 以下紧顶级任务可修改 if ($this->parent_id === 0) { diff --git a/app/Models/ProjectTaskMailLog.php b/app/Models/ProjectTaskMailLog.php index 21a2432a1..984be8c2d 100644 --- a/app/Models/ProjectTaskMailLog.php +++ b/app/Models/ProjectTaskMailLog.php @@ -5,6 +5,8 @@ namespace App\Models; +use Illuminate\Database\Eloquent\SoftDeletes; + /** * App\Models\ProjectTaskMailLog * @@ -16,10 +18,12 @@ namespace App\Models; * @property int|null $is_send 邮件发送是否成功:0否,1是 * @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\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) @@ -31,6 +35,6 @@ namespace App\Models; */ class ProjectTaskMailLog extends AbstractModel { - + use SoftDeletes; } diff --git a/database/migrations/2022_03_09_100139_add_project_task_mail_logs_add_deletes.php b/database/migrations/2022_03_09_100139_add_project_task_mail_logs_add_deletes.php new file mode 100644 index 000000000..133e6f8c5 --- /dev/null +++ b/database/migrations/2022_03_09_100139_add_project_task_mail_logs_add_deletes.php @@ -0,0 +1,34 @@ +softDeletes(); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('project_task_mail_logs', function (Blueprint $table) { + $table->dropSoftDeletes(); + }); + } +}