Browse Source

添加赛制字段

lrf 2 years ago
parent
commit
31bdc08986
2 changed files with 4 additions and 1 deletions
  1. 2 0
      app/controller/.schedule.js
  2. 2 1
      app/model/schedule.js

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

@@ -21,6 +21,7 @@ module.exports = {
       'remark',
       'remark',
       'match_position',
       'match_position',
       'is_bye',
       'is_bye',
+      'format',
     ],
     ],
   },
   },
   destroy: {
   destroy: {
@@ -50,6 +51,7 @@ module.exports = {
       'remark',
       'remark',
       'match_position',
       'match_position',
       'is_bye',
       'is_bye',
+      'format',
     ],
     ],
   },
   },
   show: {
   show: {

+ 2 - 1
app/model/schedule.js

@@ -26,6 +26,7 @@ const schedule = {
   status: { type: String, default: '0' }, // 状态
   status: { type: String, default: '0' }, // 状态
 
 
   match_position: { type: String }, // 比赛流程图位置,可以用来计算晋级后的位置
   match_position: { type: String }, // 比赛流程图位置,可以用来计算晋级后的位置
+  format: { type: Array }, //赛制
   is_bye: { type: Boolean, default: false }, // 是否轮空, 轮空只有1个队伍
   is_bye: { type: Boolean, default: false }, // 是否轮空, 轮空只有1个队伍
   remark: { type: String },
   remark: { type: String },
 };
 };
@@ -38,7 +39,7 @@ schema.index({ match_time: 1 });
 schema.index({ status: 1 });
 schema.index({ status: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);
 schema.plugin(metaPlugin);
-module.exports = app => {
+module.exports = (app) => {
   const { mongoose } = app;
   const { mongoose } = app;
   return mongoose.model('Schedule', schema, 'schedule');
   return mongoose.model('Schedule', schema, 'schedule');
 };
 };