lrf402788946 преди 4 години
родител
ревизия
91efbf0ff8
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      app/service/leave.js

+ 1 - 1
app/service/leave.js

@@ -20,7 +20,7 @@ class LeaveService extends CrudService {
     const student = await this.smodel.findById(studentid);
     const schid = student.schid;
     const newdata = { ...data, status: '0', schid };
-    let sch = await this.ctx.model.School.find({ code: schid });
+    let sch = await this.ctx.model.School.findOne({ code: schid });
     if (!sch) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到该学生的学校信息');
     sch = JSON.parse(JSON.stringify(sch));
     const { _id } = sch;