@@ -129,4 +129,8 @@ module.exports = {
count: true
}
},
+ fetchteachers:{
+ requestBody:["!ids"],
+ service:'fetchteachers'
+ }
};
@@ -47,6 +47,7 @@ module.exports = app => {
controller.teacher.status
);
router.post('/api/train/teacher/teaimport', controller.teacher.teaimport);
+ router.post('/api/train/teacher/fetchteachers', controller.teacher.fetchteachers);
// 作业表配置路由
router.resources('task', '/api/train/task', controller.task); // index、create、show、destroy
@@ -27,6 +27,12 @@ class TeacherService extends CrudService {
return await this.model.findById(id, '+file');
+ // 批量查询教师
+ async fetchteachers({ ids }) {
+ return await this.model.find({ _id: { $in: ids } });
+
async status(data) {
const { teachersid, zlscore, msscore, status, remark } = data;
for (const teacherid of teachersid) {