From b54d1c3ffbe6167f96d057f37ef1396a3f403795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Thu, 11 Dec 2025 16:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E7=BA=A6=E6=9C=9F=E9=97=B4=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E7=AD=BE=E7=BA=A6=20=E5=B8=88=E5=BE=92=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E4=BB=BB=E5=8A=A121=2022=2023=20=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Sign.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/application/api/model/Sign.php b/application/api/model/Sign.php index c38896db..141fa266 100644 --- a/application/api/model/Sign.php +++ b/application/api/model/Sign.php @@ -264,6 +264,14 @@ class Sign extends Model db::rollback(); return ['code' => 0, 'msg' => '网络错误,请重试', 'data' => null]; } + + //查找是否有未完成的师徒任务 有就删除掉 + $student = db::name('vs_tasks_student')->where(['student_id' => $sign_user_id,'status' => 0])->select(); + if($student){ + foreach ($student as &$v){ + db::name('vs_tasks_student')->where(['id' => $v['id']])->updaatte(['delete_time' => time()]); + } + } }else{ $data = [ 'parent_user_id' => $max_sign_user['user_id'], @@ -401,7 +409,7 @@ class Sign extends Model 'createtime' => time() ]; } - db::name('vs_task_student')->insertAll($data_list); + db::name('vs_tasks_student')->insertAll($data_list); } //判定是否 今日第一次签约徒弟 $is_first_sign_student = db::name('vs_user_sign')->where(['parent_user_id' => $max_sign_user['user_id'],'createtime' => ['>=',strtotime(date('Y-m-d'))]])->count();