asd123a20 3 年之前
父节点
当前提交
3caad6376b
共有 6 个文件被更改,包括 12 次插入15 次删除
  1. 2 2
      app/controller/subject.json
  2. 2 2
      app/controller/weixin.js
  3. 3 3
      app/model/order.js
  4. 2 2
      app/model/subject.js
  5. 2 5
      app/service/order.js
  6. 1 1
      app/service/weixin.js

+ 2 - 2
app/controller/subject.json

@@ -13,8 +13,8 @@
         "query": ["hospitalId", "name"]
       },
       "options": {
-        "count": true,
-        "query": ["skip", "limit"]
+        "query": ["skip", "limit"],
+        "count": true
       }
     },
     "fetch": {

+ 2 - 2
app/controller/weixin.js

@@ -126,8 +126,8 @@ class LoginController extends Controller {
   }
   // 预支付订单
   async orderPay() {
-    const { openid, money, out_trade_no, hospitalName, subjectName, specialistName, _id } = this.ctx.request.body;
-    await this.ctx.service.weixin.orderPay({ openid, money, out_trade_no, description: `${hospitalName}-${subjectName}-${specialistName}`, _id });
+    const { openid, money, out_trade_no, hospitalName, subjectName, _id } = this.ctx.request.body;
+    await this.ctx.service.weixin.orderPay({ openid, money, out_trade_no, description: `${hospitalName}-${subjectName}`, _id });
     this.ctx.ok();
   }
   // 支付接口

+ 3 - 3
app/model/order.js

@@ -11,9 +11,9 @@ const SchemaDefine = {
   hospitalName: { type: String, required: true }, // 医院名称
   subjectId: { type: String, required: true }, // 科室id
   subjectName: { type: String, required: true }, // 科室名称
-  specialistId: { type: String, required: true }, // 专家id
-  specialistName: { type: String, required: true }, // 专家名称
-  money: { type: String, required: true }, // 金额
+  specialistId: { type: String, required: false }, // 专家id
+  specialistName: { type: String, required: false }, // 专家名称
+  money: { type: String, required: false, default: '0' }, // 金额
   status: { type: String, required: false, default: '0' }, // 付款状态
   remark: { type: String, required: false }, // 备注
   out_trade_no: { type: String, required: true }, // 订单号

+ 2 - 2
app/model/subject.js

@@ -2,10 +2,10 @@
 const Schema = require('mongoose').Schema;
 
 const SchemaDefine = {
-  thumbnail: { type: String, required: true },
+  thumbnail: { type: String, required: false },
   name: { type: String, required: true },
   hospitalId: { type: String, required: true },
-  content: { type: String, required: true },
+  content: { type: String, required: false },
   code: { type: String, required: true },
 };
 const schema = new Schema(SchemaDefine);

+ 2 - 5
app/service/order.js

@@ -9,7 +9,7 @@ class OrderService extends CrudService {
     super(ctx, 'order');
     this.model = this.ctx.model.Order;
   }
-  async create({ name, phone, openid, code, hospitalId, hospitalName, subjectId, subjectName, specialistId, specialistName, money, status, remark }) {
+  async create({ name, phone, openid, code, hospitalId, hospitalName, subjectId, subjectName, status, remark, code1 }) {
     assert(name, '请填写完整信息');
     assert(phone, '请填写完整信息');
     assert(openid, '请填写完整信息');
@@ -18,13 +18,10 @@ class OrderService extends CrudService {
     assert(hospitalName, '请填写完整信息');
     assert(subjectId, '请填写完整信息');
     assert(subjectName, '请填写完整信息');
-    assert(specialistId, '请填写完整信息');
-    assert(specialistName, '请填写完整信息');
-    assert(money, '请填写完整信息');
     const time = moment().format('YYYY-MM-DD HH:mm:ss');
     let out_trade_no = uuid.v1();
     out_trade_no = out_trade_no.replace(/-/g, '');
-    const res = await this.model.create({ name, phone, openid, time, code, hospitalId, hospitalName, subjectId, subjectName, specialistId, specialistName, money, status, remark, out_trade_no });
+    const res = await this.model.create({ name, phone, openid, time, code, hospitalId, hospitalName, subjectId, subjectName, status, remark, out_trade_no, code1 });
     return res;
   }
   async updatestatus({ out_trade_no }) {

+ 1 - 1
app/service/weixin.js

@@ -128,7 +128,7 @@ class WeixinAuthService extends AxiosService {
             color: '#173177',
           },
           remark: {
-            value: '我们将会尽快处理您的预约请求。',
+            value: '请保持电话畅通,等待客服与您联系。',
             color: '#173177',
           },
         },