cheny пре 4 година
родитељ
комит
17c2130ef4
4 измењених фајлова са 8 додато и 1 уклоњено
  1. 4 1
      app/controller/.student.js
  2. 1 0
      app/model/student.js
  3. 2 0
      app/service/trainplan.js
  4. 1 0
      app/service/user.js

+ 4 - 1
app/controller/.student.js

@@ -33,6 +33,7 @@ module.exports = {
       "selfscore",
       "score",
       "diy",
+      "isComming",
     ],
   },
   destroy: {
@@ -74,6 +75,7 @@ module.exports = {
       "selfscore",
       "score",
       "diy",
+      "isComming",
     ],
   },
   show: {
@@ -116,7 +118,8 @@ module.exports = {
         is_fine: "is_fine",
         selfscore: "selfscore",
         score: "score",
-        diy:"diy"
+        diy: "diy",
+        isComming:"isComming",
       },
     },
     service: "query",

+ 1 - 0
app/model/student.js

@@ -36,6 +36,7 @@ const StudentSchema = {
   selfscore: { type: String, required: false, maxLength: 200, zh: '个人分' }, // 个人分
   score: { type: String, required: false, maxLength: 200, zh: '总分' }, // 总分
   diy: { type: { Object }, required: false, zh: '自定义' }, // 自定义
+  isComming: { type: String, default: '0', zh: '签到' }, // 是否签到0否,1是
 };
 
 

+ 2 - 0
app/service/trainplan.js

@@ -240,6 +240,7 @@ class TrainplanService extends CrudService {
       const trainplandName = trainplan.title;
       // 在计划中找到这个学生在哪期以及哪期下的哪批次
       for (const student of studentList) {
+        student.isComming = utils.getIsNot(student.isComming);
         student.trainplandName = trainplandName;
         // 期次
         const term = trainplan.termnum.filter(term => {
@@ -287,6 +288,7 @@ class TrainplanService extends CrudService {
         // { key: 'selfscore', title: '个人分' },
         // { key: 'score', title: '总分' },
         // { key: 'diy', title: '自定义' },
+        { key: 'isComming', title: '是否签到' },
       ];
 
       // 需要打出的列表

+ 1 - 0
app/service/user.js

@@ -94,6 +94,7 @@ class UserService extends CrudService {
         throw new BusinessError(ErrorCode.USER_NOT_EXIST);
       }
       stud.openid = openid;
+      stud.isComming = '1';
       await stud.save();
       const newdata = { name: stud.name, mobile: stud.phone, type: '4', uid: stud.id, openid, unionid };
       newdata.passwd = { secret: '12345678' };