ソースを参照

更新咨询师字段

lrf 3 年 前
コミット
a934857cb7
2 ファイル変更19 行追加3 行削除
  1. 6 2
      app/controller/config/.consulting.js
  2. 13 1
      app/model/consulting.js

+ 6 - 2
app/controller/config/.consulting.js

@@ -1,6 +1,6 @@
 module.exports = {
   create: {
-    requestBody: ['pid', 'name', 'phone', 'password', 'card', 'email', 'address'],
+    requestBody: ['pid', 'name', 'phone', 'password', 'card', 'email', 'address', 'zwzc', 'school', 'major', 'word_tel', 'type', 'code', 'role', 'status'],
   },
   destroy: {
     params: ['!id'],
@@ -8,7 +8,7 @@ module.exports = {
   },
   update: {
     params: ['!id'],
-    requestBody: ['pid', 'name', 'phone', 'password', 'card', 'email', 'address'],
+    requestBody: ['pid', 'name', 'phone', 'password', 'card', 'email', 'address', 'zwzc', 'school', 'major', 'word_tel', 'type', 'code', 'role', 'status'],
   },
   show: {
     parameters: {
@@ -23,6 +23,10 @@ module.exports = {
         name: 'name',
         phone: 'phone',
         card: 'card',
+        type: 'type',
+        code: 'code',
+        role: 'role',
+        status: 'status',
         'meta.createdAt@start': 'meta.createdAt@start',
         'meta.createdAt@end': 'meta.createdAt@end',
       },

+ 13 - 1
app/model/consulting.js

@@ -11,7 +11,15 @@ const consulting = {
   password: { type: Secret, select: false }, // 密码
   card: { type: String }, // 身份证号
   email: { type: String }, // 电子邮箱
-  address: { type: String },
+  address: { type: String }, // 联系地址
+  zwzc: { type: String }, // 职务职称
+  school: { type: String }, // 所在院校
+  major: { type: String }, // 所学专业
+  word_tel: { type: String }, // 办公电话
+  type: { type: String }, // 用户类型:1-咨询师;2-代理师;3-分析师
+  code: { type: String, required: false }, // 邀请码
+  role: { type: String, default: '11' }, // 角色
+  status: { type: String, required: false, default: '0', maxLength: 200 }, // 审核状态,0-注册,1-通过,2-拒绝
   remark: { type: String },
 };
 const schema = new Schema(consulting, { toJSON: { virtuals: true } });
@@ -20,6 +28,10 @@ schema.index({ pid: 1 });
 schema.index({ name: 1 });
 schema.index({ phone: 1 });
 schema.index({ card: 1 });
+schema.index({ type: 1 });
+schema.index({ code: 1 });
+schema.index({ role: 1 });
+schema.index({ status: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);
 module.exports = app => {