'use strict'; const Schema = require('mongoose').Schema; const moment = require('moment'); const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin'); const { ObjectId } = require('mongoose').Types; const { Secret } = require('naf-framework-mongoose/lib/model/schema'); // 科教之旅-机构表 const kjzl_medium = { name: { type: String }, // 名称 contact: { type: String }, // 联系人 phone: { type: String }, // 联系电话 addr: { type: String }, // 地址 belong: { type: String }, // 所属:中科/吉科 password: { type: Secret, required: true, select: false }, // 登录密码 openid: { type: String }, // 微信openid natural: { type: String }, // 资质 achieve: { type: String }, // 成果 condition: { type: String }, // 条件 team: { type: String }, // 团队 img_file: { type: Array }, // 图片 project: { type: Array }, // 服务项目 equipment: { type: Array }, // 设备共享 remark: { type: String }, }; const schema = new Schema(kjzl_medium, { toJSON: { virtuals: true } }); schema.index({ id: 1 }); schema.index({ name: 1 }); schema.index({ contact: 1 }); schema.index({ phone: 1 }); schema.index({ addr: 1 }); schema.index({ belong: 1 }); schema.index({ openid: 1 }); schema.index({ 'meta.createdAt': 1 }); schema.plugin(metaPlugin); module.exports = app => { const { mongoose } = app; return mongoose.model('Kjzl_medium', schema, 'kjzl_medium'); };