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

+ 2 - 1
app/service/statistics.js

@@ -260,7 +260,8 @@ class StatisticsService extends CrudService {
       else if (!start) obj.name = `${end}岁以下`;
       else if (!end) obj.name = `${start}岁以上`;
       const l = list.filter(f => {
-        const age = _.get(f, 'student_id.age');
+        const birth = _.get(f, 'sstudent_id.birth');
+        const age = moment().diff(birth, 'years');
         if (start && end) return age >= start && age <= end;
         else if (!start) return age <= end;
         else if (!end) return age >= start;