lrf402788946 4 年之前
父節點
當前提交
e11a52307a
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      app/service/student.js

+ 4 - 2
app/service/student.js

@@ -424,7 +424,7 @@ class StudentService extends CrudService {
     for (const id of ids) {
     for (const id of ids) {
       const cla = await this.ctx.service.class.fetch({ id });
       const cla = await this.ctx.service.class.fetch({ id });
       if (!cla) continue;
       if (!cla) continue;
-      if (type !== 'insurance') { cla.date = moment(cla.startdate).add(1, 'd').format('YYYY-MM-DD'); }
+      if (type === 'insurance') { cla.date = moment(cla.startdate).add(1, 'd').format('YYYY-MM-DD'); }
       classList.push(cla);
       classList.push(cla);
     }
     }
     studentList = studentList.map(i => {
     studentList = studentList.map(i => {
@@ -435,7 +435,9 @@ class StudentService extends CrudService {
     const meta = this.metaBx(type);
     const meta = this.metaBx(type);
     let fn = '学生名单';
     let fn = '学生名单';
     const head = _.head(classList);
     const head = _.head(classList);
-    if (head) fn = `${head.term}期-${head.batch}批${fn}`;
+    if (head) {
+      if (type === 'class') { fn = `${head.term}期-${head.batch}批-${head.name}${fn}`; } else fn = `${head.term}期-${head.batch}批${fn}`;
+    }
     return await this.ctx.service.util.toExcel(studentList, meta, fn);
     return await this.ctx.service.util.toExcel(studentList, meta, fn);
   }
   }