guhongwei 4 år sedan
förälder
incheckning
9ff9a753fa

+ 21 - 2
app/controller/kjzl/.kjzl_chat.js

@@ -1,6 +1,14 @@
 module.exports = {
   create: {
-    requestBody: [],
+    requestBody: [
+      "medium_id",
+      "openid",
+      "project",
+      "orderid",
+      "create_time",
+      "content",
+      "remark",
+    ],
   },
   destroy: {
     params: ["!id"],
@@ -8,7 +16,15 @@ module.exports = {
   },
   update: {
     params: ["!id"],
-    requestBody: [],
+    requestBody: [
+      "medium_id",
+      "openid",
+      "project",
+      "orderid",
+      "create_time",
+      "content",
+      "remark",
+    ],
   },
   show: {
     parameters: {
@@ -19,6 +35,9 @@ module.exports = {
   index: {
     parameters: {
       query: {
+        medium_id: "medium_id",
+        openid: "openid",
+        orderid: "orderid",
         "create_time@start": "create_time@start",
         "create_time@end": "create_time@end",
       },

+ 8 - 0
app/controller/kjzl/.kjzl_order.js

@@ -9,6 +9,10 @@ module.exports = {
       "email",
       "server_time",
       "remark",
+      "type",
+      "invoice",
+      "company",
+      "number",
       "status",
     ],
   },
@@ -27,6 +31,10 @@ module.exports = {
       "email",
       "server_time",
       "remark",
+      "type",
+      "invoice",
+      "company",
+      "number",
       "status",
     ],
   },

+ 6 - 2
app/model/kjzl/kjzl_chat.js

@@ -6,7 +6,9 @@ const { ObjectId } = require('mongoose').Types;
 // 科教之旅-评价表
 const kjzl_chat = {
   medium_id: { type: ObjectId }, // 机构id
-  user_id: { type: ObjectId }, // 用户id
+  openid: { type: String }, // 用户id
+  project: { type: Object }, // 服务项目
+  orderid: { type: String }, // 订单id
   create_time: { type: String }, // 时间
   content: { type: String }, // 评价内容
   remark: { type: String },
@@ -14,7 +16,9 @@ const kjzl_chat = {
 const schema = new Schema(kjzl_chat, { toJSON: { virtuals: true } });
 schema.index({ id: 1 });
 schema.index({ medium_id: 1 });
-schema.index({ user_id: 1 });
+schema.index({ openid: 1 });
+schema.index({ project: 1 });
+schema.index({ orderid: 1 });
 schema.index({ create_time: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);

+ 9 - 1
app/model/kjzl/kjzl_order.js

@@ -7,12 +7,16 @@ const { ObjectId } = require('mongoose').Types;
 const kjzl_order = {
   medium_id: { type: ObjectId }, // 机构id
   openid: { type: String }, // 微信openid
-  project: { type: String }, // 服务项目
+  project: { type: Object }, // 服务项目
   contact: { type: String }, // 联系人
   phone: { type: String }, // 联系电话
   email: { type: String }, // 邮件
   server_time: { type: String }, // 服务时间
   remark: { type: String }, // 预约备注
+  type: { type: String }, // 服务类型
+  invoice: { type: String }, // 开具发票
+  company: { type: String }, // 公司名称
+  number: { type: String }, // 纳税人识别号
   status: { type: String, default: '0' }, // 状态:0-预约;1-完成
 };
 const schema = new Schema(kjzl_order, { toJSON: { virtuals: true } });
@@ -23,6 +27,10 @@ schema.index({ project: 1 });
 schema.index({ contact: 1 });
 schema.index({ phone: 1 });
 schema.index({ server_time: 1 });
+schema.index({ type: 1 });
+schema.index({ invoice: 1 });
+schema.index({ company: 1 });
+schema.index({ number: 1 });
 schema.index({ status: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);