lrf402788946 4 سال پیش
والد
کامیت
88448f19a3
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      app/service/student.js

+ 2 - 4
app/service/student.js

@@ -42,12 +42,11 @@ class StudentService extends CrudService {
   }
 
   async delete({ id }) {
-    // 删除小组中的这个人,作业表,问卷表,评分,请假,考勤,用户表,学生表
-    await this.gmodel.update({ 'students.stuid': id }, { $pull: { students: { id } } });
+    // 删除小组中的这个人,作业表,问卷表,评分,考勤,用户表,学生表
+    await this.gmodel.update({ 'students.stuid': id }, { $pull: { students: { stuid: id } } });
     await this.upmodel.deleteMany({ studentid: id });
     await this.uqmodel.deleteMany({ studentid: id });
     await this.scoremodel.deleteMany({ stuid: id });
-    await this.leavemodel.deleteMany({ studentid: id });
     await this.attendmodel.deleteMany({ studentid: id });
     await this.umodel.deleteOne({ uid: id });
     await this.model.deleteOne({ _id: ObjectId(id) });
@@ -247,7 +246,6 @@ class StudentService extends CrudService {
     //   await this.upmodel.deleteMany({ studentid: id });
     //   await this.uqmodel.deleteMany({ studentid: id });
     //   await this.scoremodel.deleteMany({ stuid: id });
-    //   await this.leavemodel.deleteMany({ studentid: id });
     //   await this.attendmodel.deleteMany({ studentid: id });
     // }
   }