lrf402788946 hace 4 años
padre
commit
2c756c04df
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      app/service/chatroom.js

+ 1 - 1
app/service/chatroom.js

@@ -18,7 +18,7 @@ class ChatroomService extends CrudService {
     assert(teacher, '缺少教师姓名');
     assert(studentid, '缺少学生id');
     assert(student, '缺少学生姓名');
-    const res = await this.model.find({ teacherid, teacher, studentid, student });
+    const res = await this.model.findOne({ teacherid, teacher, studentid, student });
     if (res) return res;
     const cres = await this.model.create({ teacherid, teacher, studentid, student });
     return cres;