reloaded 5 anni fa
parent
commit
ea32aef397
2 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 1 1
      app/service/apply.js
  2. 7 1
      app/service/teacher.js

+ 1 - 1
app/service/apply.js

@@ -18,7 +18,7 @@ class ApplyService extends CrudService {
   async queryteacher(num) {
     console.log(num);
     const { termid, subid } = num;
-    const data = await this.model.find({ termid, subid });
+    const data = await this.model.find({ termid, subid }).sort({ msscore: -1 });
     const teachers = [];
     for (const _data of data) {
       const teacherid = _data.teacherid;

+ 7 - 1
app/service/teacher.js

@@ -27,10 +27,16 @@ class TeacherService extends CrudService {
   }
 
   async status(data) {
-    const { teachersid, status, remark } = data;
+    const { teachersid, zlscore, msscore, status, remark } = data;
     for (const teacherid of teachersid) {
       const teacher = await this.model.findById(teacherid);
       teacher.status = status;
+      if (zlscore) {
+        teacher.zlscore = zlscore;
+      }
+      if (msscore) {
+        teacher.msscore = msscore;
+      }
       await teacher.save();
       let detail = '';
       if (status === '1') {