12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- /**
- * 用户数据模型
- *
- * @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,
- // 真实姓名
- real_name: String,
- // 公司
- company: String,
- // 省份
- province: Number,
- // 公司类型
- company_type: {
- type: Number,
- default: -1
- },
- // 公司规模
- company_scale: {
- type: Number,
- default: -1
- },
- // 最后登录时间
- last_login: {
- type: Number,
- default: 0
- },
- // 创建时间
- 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}));
|