|
@@ -11,6 +11,19 @@ class TeaplanService extends CrudService {
|
|
|
constructor(ctx) {
|
|
|
super(ctx, 'teaplan');
|
|
|
this.model = this.ctx.model.Teaplan;
|
|
|
+ this.hmodel = this.ctx.model.Headteacher;
|
|
|
+ }
|
|
|
+
|
|
|
+ async findteacher({ batchid }) {
|
|
|
+ const teaplans = await this.model.find();
|
|
|
+ const headteachers = [];
|
|
|
+ for (const teaplan of teaplans) {
|
|
|
+ if (!teaplan.nobatchid.includes(batchid)) {
|
|
|
+ const headteahcer = await this.hmodel.findById(teaplan.headteacherid);
|
|
|
+ headteachers.push(headteahcer);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return headteachers;
|
|
|
}
|
|
|
|
|
|
}
|