lrf402788946 4 gadi atpakaļ
vecāks
revīzija
245e9c4d78
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      app/service/school.js

+ 4 - 4
app/service/school.js

@@ -141,12 +141,11 @@ class SchoolService extends CrudService {
     arrange = _.groupBy(arrange, 'termid');
     const keys = Object.keys(arrange);
     let arr = keys.map(key => {
-      const rt = termnum.find(f => f.termid === key);
-      console.log('rt=>');
-      console.log(rt);
+      const rt = termnum.find(f => ObjectId(key).equals(f._id));
       let ar = arrange[key];
       ar = ar.map(a => {
-        const rb = rt.batchnum.find(f => f._id === a.batchid);
+        const rb = rt.batchnum.find(f => ObjectId(a.batchid).equals(f._id));
+        console.log(rb);
         if (rb) {
           const bh = _.head(rb.class);
           const { type } = bh;
@@ -154,6 +153,7 @@ class SchoolService extends CrudService {
           return a;
         }
       });
+      console.log(ar);
       let garr = _.groupBy(ar, 'type');
       const gks = Object.keys(garr);
       garr = gks.map(gk => {