lrf402788946 4 年之前
父节点
当前提交
b40e4a237c
共有 2 个文件被更改,包括 583 次插入517 次删除
  1. 576 517
      app/service/class.js
  2. 7 0
      app/service/util.js

文件差异内容过多而无法显示
+ 576 - 517
app/service/class.js


+ 7 - 0
app/service/util.js

@@ -86,6 +86,13 @@ class UtilService extends CrudService {
     return res;
   }
   async utilMethod(query, body) {
+    const { planid, termid, batchid, classid } = query;
+    const filters = {};
+    if (classid) filters.classid = classid;
+    else if (batchid)filters.batchid = batchid;
+    else if (termid)filters.termid = termid;
+    else if (planid)filters.planid = planid;
+    await this.ctx.model.Student.updateMany(filters, { classid: undefined });
     // const ch = await this.ctx.amqp.conn.createChannel();
     // const queue = 'hello';
     // ch.consume(