|
@@ -50,7 +50,7 @@ class NoticeService extends CrudService {
|
|
|
personList = [ ...sList, ...tList, ...hList ];
|
|
|
} else if (type === '1') personList = await this.getRangeStudent({ classid });
|
|
|
else if (type === '2') personList = await this.getRangeTeacher({ classid });
|
|
|
- else if (type === '3') personList = await this.getRangeClasses({ id: classid });
|
|
|
+ else if (type === '3') personList = await this.getRangeClasses({ _id: classid });
|
|
|
}
|
|
|
personList = personList.map(i => i._id);
|
|
|
|
|
@@ -63,8 +63,8 @@ class NoticeService extends CrudService {
|
|
|
const openid = _.get(user, 'openid');
|
|
|
const title = '您有一个新的通知';
|
|
|
const detail = content;
|
|
|
- const tourl = this.ctx.app.config.baseUrl + '/trainnotice/?userid=' + user.uid + '¬iceid=' + res.id;
|
|
|
- await this.toSendWithUrl(title, openid, detail, tourl);
|
|
|
+ const tourl = this.ctx.app.config.baseUrl + '/trainnotice/?userid=' + user.uid + '¬iceid=';
|
|
|
+ await this.toSendWithUrl(title, openid, detail, tourl);
|
|
|
const notified = _.get(res, 'notified', []);
|
|
|
notified.push({ notifiedid: user.uid, username: user.name });
|
|
|
res.notified = notified;
|
|
@@ -94,19 +94,19 @@ class NoticeService extends CrudService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- * 根据条件返回班主任+礼仪教师列表
|
|
|
- * @param {Object} condition 查询班主任+礼仪教师条件
|
|
|
+ * 根据条件返回班主任 不加礼仪教师列表消息了
|
|
|
+ * @param {Object} condition 查询班主任
|
|
|
*/
|
|
|
- async getRangeClasses({ _id, termid }) {
|
|
|
+ async getRangeClasses({ _id, ...info }) {
|
|
|
let resList = [];
|
|
|
- if (_.id) {
|
|
|
- const cla = await this.clsmodel.findOne(_id);
|
|
|
- if (cla) resList.push(cla.headteacherid, cla.lyteacherid);
|
|
|
+ if (_id) {
|
|
|
+ const cla = await this.clsmodel.findOne({ _id: ObjectId(_id) });
|
|
|
+ if (cla) resList.push(cla.headteacherid);
|
|
|
} else {
|
|
|
- const classesList = await this.clsmodel.find(termid);
|
|
|
+ const classesList = await this.clsmodel.find(info);
|
|
|
if (classesList) {
|
|
|
for (const cla of classesList) {
|
|
|
- resList.push(cla.headteacherid, cla.lyteacherid);
|
|
|
+ resList.push(cla.headteacherid);
|
|
|
}
|
|
|
}
|
|
|
}
|