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(