Pārlūkot izejas kodu

增加考勤表内学校id

liuyu 4 gadi atpakaļ
vecāks
revīzija
b9dfa8c34a

+ 3 - 0
app/controller/.attendance.js

@@ -5,6 +5,7 @@ module.exports = {
       'batchid',
       'classid',
       'studentid',
+      'schid',
       'attend'
     ]
   },
@@ -19,6 +20,7 @@ module.exports = {
       'batchid',
       'classid',
       'studentid',
+      'schid',
       'attend'
     ]
   },
@@ -35,6 +37,7 @@ module.exports = {
         batchid:'batchid',
         classid :'classid',
         studentid :'studentid',
+        schid: 'schid',
         attend :'attend'
       }
     },

+ 1 - 0
app/model/attendance.js

@@ -15,6 +15,7 @@ const AttendanceSchema = {
   termid: { type: String, required: false, maxLength: 200 }, // 期id
   batchid: { type: String, required: false, maxLength: 200 }, // 批次id
   classid: { type: String, required: false, maxLength: 200 }, // 班级id
+  schid: { type: String, required: false, maxLength: 200 }, // 学校id
   studentid: { type: String, required: false, maxLength: 200 }, // 学生id
   attend: { type: [ attendInfo ], select: true }, // 考勤信息
 };

+ 2 - 0
app/service/attendance.js

@@ -81,6 +81,7 @@ class AttendanceService extends CrudService {
           batchid: student.batchid,
           classid: student.classid,
           studentid: student.id,
+          schid: student.schid,
           attend: [ newData ],
         };
         await this.model.create(newdata);
@@ -123,6 +124,7 @@ class AttendanceService extends CrudService {
           batchid: student.batchid,
           classid: student.classid,
           studentid: student.id,
+          schid: student.schid,
           attend: [ newData ],
         };
         await this.model.create(newdata);