'use strict'; const Schema = require('mongoose').Schema; const moment = require('moment'); const metaPlugin = require('naf-framework-mongoose-free/lib/model/meta-plugin'); const { ObjectId } = require('mongoose').Types; // 解散团队 const dismissapply = { team_id: { type: String }, // 团队id team_name: { type: String }, // 团队名称 create_user: { type: String }, // 团队创建人 create_id: { type: String }, // 团队创建人id apply_time: { type: String }, // 申请时间 resaon: { type: String }, // 解散团队原因 status: { type: String, default: '0' }, // 状态 remark: { type: String }, }; const schema = new Schema(dismissapply, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ team_id: 1 }); schema.index({ create_id: 1 }); schema.index({ apply_time: 1 }); schema.index({ status: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Dismissapply', schema, 'dismissapply'); };