'use strict'; module.exports = app => { const mongoose = app.mongoose; const Schema = mongoose.Schema; const FamilySchema = new Schema({ dept1: { type: Schema.Types.ObjectId, ref: 'sysDept', }, dept2: { type: Schema.Types.ObjectId, ref: 'sysDept', }, dept3: { type: Schema.Types.ObjectId, ref: 'sysDept', }, dept4: { type: Schema.Types.ObjectId, ref: 'sysDept', }, dept5: { type: Schema.Types.ObjectId, ref: 'sysDept', }, userid: { type: Schema.Types.ObjectId, ref: 'sysUser', }, // userName: { type: String }, // 采集员 time: { type: Date, default: Date.now }, openId: { type: Array }, // 赡养人微信openid // appletId: { type: Array }, // 赡养人小程序openid }); return mongoose.model('Family', FamilySchema, 'family'); };