Prechádzať zdrojové kódy

增加全天 半天

liuyu 5 rokov pred
rodič
commit
5c8daf4959

+ 2 - 0
app/controller/.lessonmode.js

@@ -3,6 +3,7 @@ module.exports = {
     requestBody: [
       '!title',
       '!type',
+      'allday',
       'lessons'
     ]
   },
@@ -15,6 +16,7 @@ module.exports = {
     requestBody: [
       'title',
       'type',
+      'allday',
       'lessons'
     ]
   },

+ 1 - 0
app/model/lessonmode.js

@@ -6,6 +6,7 @@ const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const LessonmodeSchema = {
   title: { type: String, required: true, maxLength: 500 }, // 标题
   type: { type: String, required: true, maxLength: 500 }, // 类型,0-普通班,1-特殊班
+  allday: { type: String, required: false, maxLength: 20 }, // 类型,0-全天,1-半天
   lessons: { type: String, required: false }, // 课程信息
 };
 

+ 5 - 1
app/service/lesson.js

@@ -60,7 +60,11 @@ class LessonService extends CrudService {
                 } else {
                   _subid = '';
                 }
-                const data = { subid: _subid, date: day, time: lessm.time };
+                let allday = 0;
+                if (i === 6) {
+                  allday = _lessonmode.allday;
+                }
+                const data = { subid: _subid, subname: lessm['day' + i], date: day, time: lessm.time, day: allday };
                 newlesson.push(data);
               }
             }