|
@@ -14,28 +14,28 @@ class TeaplanService extends CrudService {
|
|
|
this.hmodel = this.ctx.model.Headteacher;
|
|
|
}
|
|
|
|
|
|
- async findteacher({ batchid }) {
|
|
|
- // 查询所有班主任信息
|
|
|
- const headteachers = await this.hmodel.find();
|
|
|
- const newheadteachers = [];
|
|
|
- // 遍历班主任信息
|
|
|
- for (const headteacher of headteachers) {
|
|
|
- // 查询某班主任对应的班主任全年计划表
|
|
|
- const teaplan = await this.model.findOne({ headteacherid: headteacher.id });
|
|
|
- if (teaplan) {
|
|
|
- const nobatchids = teaplan.nobatchid;
|
|
|
- // 如果有对应的全年计划表并且该计划表中的不能上课的批次包含指定批次,则添加status='0'的标记
|
|
|
- if (nobatchids.includes(batchid)) {
|
|
|
- newheadteachers.push({ ...JSON.parse(JSON.stringify(headteacher)), status: '0' });
|
|
|
- } else {
|
|
|
- newheadteachers.push(headteacher);
|
|
|
- }
|
|
|
- } else {
|
|
|
- newheadteachers.push(headteacher);
|
|
|
- }
|
|
|
- }
|
|
|
- return newheadteachers;
|
|
|
- }
|
|
|
+ // async findteacher({ batchid }) {
|
|
|
+ // // 查询所有班主任信息
|
|
|
+ // const headteachers = await this.hmodel.find();
|
|
|
+ // const newheadteachers = [];
|
|
|
+ // // 遍历班主任信息
|
|
|
+ // for (const headteacher of headteachers) {
|
|
|
+ // // 查询某班主任对应的班主任全年计划表
|
|
|
+ // const teaplan = await this.model.findOne({ headteacherid: headteacher.id });
|
|
|
+ // if (teaplan) {
|
|
|
+ // const nobatchids = teaplan.nobatchid;
|
|
|
+ // // 如果有对应的全年计划表并且该计划表中的不能上课的批次包含指定批次,则添加status='0'的标记
|
|
|
+ // if (nobatchids.includes(batchid)) {
|
|
|
+ // newheadteachers.push({ ...JSON.parse(JSON.stringify(headteacher)), status: '0' });
|
|
|
+ // } else {
|
|
|
+ // newheadteachers.push(headteacher);
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // newheadteachers.push(headteacher);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return newheadteachers;
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
|