1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- /**
- * 用户数据模型
- *
- * @author CaiAoLin
- * @date 2017/7/20
- * @version
- */
- import mongoose from "mongoose";
- let Schema = mongoose.Schema;
- let collectionName = 'users';
- let upgrade = mongoose.Schema({
- compilationID:String,//编办ID
- upgrade_time:Number,
- isUpgrade:Boolean,
- remark:String//描述:广东办刘飞 2018-06-17 启用/关闭
- }, { _id: false })
- let modelSchema = {
- // 用户名
- username: String,
- // 电子邮件
- email: String,
- // 手机号码
- mobile: String,
- // qq号码
- qq: {
- type: String,
- default: ''
- },
- // 真实姓名
- real_name: String,
- // 公司
- company: String,
- // 省份
- province: Number,
- // 公司类型
- company_type: {
- type: Number,
- default: -1
- },
- // 公司规模
- company_scale: {
- type: Number,
- default: -1
- },
- // 最后登录时间
- latest_login: {
- type: Number,
- default: 0
- },
- //最近使用编办
- latest_used:String,
- // 创建时间
- create_time: {
- type: Number,
- default: 0
- },
- upgrade_list:[upgrade],
- user_type:{
- type:String,
- default:'normal'// normal : 普通用户,test:测试用户
- }
- };
- mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));
|