lrf402788946 4 years ago
parent
commit
13c00a3251
2 changed files with 2 additions and 2 deletions
  1. 1 1
      app/model/student.js
  2. 1 1
      app/service/student.js

+ 1 - 1
app/model/student.js

@@ -44,7 +44,7 @@ const StudentSchema = {
 
 
 const schema = new Schema(StudentSchema, { toJSON: { virtuals: true } });
-schema.index({ id: 1 });
+schema.index({ id: 1, termid: 1, batchid: 1, schid: 1 });
 schema.plugin(metaPlugin);
 
 module.exports = app => {

+ 1 - 1
app/service/student.js

@@ -55,7 +55,7 @@ class StudentService extends CrudService {
     const student = await this.model.findByIdAndUpdate(id, data);
     if (student) {
       const { phone, name } = data;
-      const r = await this.umodel.findOneAndUpdate({ uid: id }, { mobile: phone, name });
+      await this.umodel.findOneAndUpdate({ uid: id }, { mobile: phone, name });
     }
     return student;
   }