lrf402788946 před 4 roky
rodič
revize
b40e4a237c
2 změnil soubory, kde provedl 583 přidání a 517 odebrání
  1. 576 517
      app/service/class.js
  2. 7 0
      app/service/util.js

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 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(