浏览代码

user表增加登录时长字段

zhangweicheng 4 年之前
父节点
当前提交
04eec3ec55
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      modules/all_models/user.js

+ 5 - 1
modules/all_models/user.js

@@ -65,7 +65,11 @@ let modelSchema = {
     user_type:{
         type:String,
         default:'normal'//  normal : 普通用户,test:测试用户
-    }
+    },
+    online_times: {
+        type: Number,
+        default: 0
+    } //最近一天的登录时长累计
 };
 mongoose.model(collectionName, new Schema(modelSchema, {versionKey: false, collection: collectionName}));