lrf 2 年之前
父節點
當前提交
9c2a4d0229
共有 3 個文件被更改,包括 3 次插入34 次删除
  1. 1 26
      app/controller/home.js
  2. 1 7
      app/service/business/payOrder.js
  3. 1 1
      config/config.default.js

+ 1 - 26
app/controller/home.js

@@ -8,32 +8,7 @@ const { ObjectId } = require('mongoose').Types;
 class HomeController extends Controller {
 class HomeController extends Controller {
   async index() {
   async index() {
     const { ctx } = this;
     const { ctx } = this;
-    const enrollModel = this.ctx.model.Enroll;
-    const teamApply = this.ctx.model.TeamApply;
-    const enrollQuery = { project_id: '62e5fff82dc7343e137ffef5', grouping_id: '62e601c72dc7343e137fff6f', status: { $ne: '0' } };
-    const teamApplyQuery = { project_id: '62e5fff82dc7343e137ffef5', grouping_id: '62e601c72dc7343e137fff6f' };
-    // 报名数据
-    const eData = await enrollModel.find(enrollQuery);
-    // 组队申请数据
-    const taData = await teamApply.find(teamApplyQuery);
-    // 查看每个申请组队的人,是否有报名数据
-    for (const ta of taData) {
-      const { applyuser_id, teammate_id } = ta;
-      const ar = eData.find(f => f.openid === applyuser_id);
-      const tr = eData.find(f => f.openid === teammate_id);
-      if (!ar) {
-        console.log('没有申请人');
-        console.log(ta);
-      } else if (!tr) {
-        console.log('没有队友');
-        console.log(ta);
-      } else if (!ar && !tr) {
-        console.log('都没有');
-        console.log(ta);
-      }
-    }
-
-    ctx.body = { eData, taData };
+    ctx.body = 'hello';
   }
   }
   /**
   /**
    * 系统管理员登陆
    * 系统管理员登陆

+ 1 - 7
app/service/business/payOrder.js

@@ -112,7 +112,7 @@ class PayOrderService extends CrudService {
     const { from_id: _id, status: is_pay, money, _id: pay_id, config } = data;
     const { from_id: _id, status: is_pay, money, _id: pay_id, config } = data;
     if (pay_for === 'lessonStudent') {
     if (pay_for === 'lessonStudent') {
       // 因为上课产生的支付,去找lessonStudent,修改指定学生的支付状态
       // 因为上课产生的支付,去找lessonStudent,修改指定学生的支付状态
-      await this.lessonStudentModel.updateOne({ _id }, { is_pay });
+      await this.lessonStudentModel.updateOne({ _id }, { is_pay, pay_id });
       // 检查下各种记录
       // 检查下各种记录
       await this.makeRecord(data);
       await this.makeRecord(data);
     } else if (pay_for === 'tempLessonApply') {
     } else if (pay_for === 'tempLessonApply') {
@@ -148,19 +148,13 @@ class PayOrderService extends CrudService {
     let wxBill;
     let wxBill;
     // 检查是否有本次微信支付部分的账单
     // 检查是否有本次微信支付部分的账单
     wxBill = await this.billModel.findOne({ pay_id });
     wxBill = await this.billModel.findOne({ pay_id });
-    console.log('data');
-    console.log(data);
-    console.log('wxBill');
-    console.log(wxBill);
     if (!wxBill) {
     if (!wxBill) {
-      console.log('line 154 in function: create wxBill');
       // 没有微信支付账单,需要创建
       // 没有微信支付账单,需要创建
       const obj = _.pick(data, [ 'school_id', 'payer_id', 'payer_role', 'pay_for', 'from_id', 'time', 'money' ]);
       const obj = _.pick(data, [ 'school_id', 'payer_id', 'payer_role', 'pay_for', 'from_id', 'time', 'money' ]);
       obj.type = '-1';
       obj.type = '-1';
       obj.pay_id = data._id;
       obj.pay_id = data._id;
       obj.is_pay = is_pay;
       obj.is_pay = is_pay;
       wxBill = await this.billModel.create(obj);
       wxBill = await this.billModel.create(obj);
-      console.log(wxBill);
     }
     }
 
 
 
 

+ 1 - 1
config/config.default.js

@@ -109,7 +109,7 @@ module.exports = appInfo => {
   // 数据库设置
   // 数据库设置
   config.dbName = 'court_v2';
   config.dbName = 'court_v2';
   config.mongoose = {
   config.mongoose = {
-    url: `mongodb://127.0.0.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
+    url: `mongodb://120.48.146.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
     options: {
     options: {
       user: 'admin',
       user: 'admin',
       pass: 'admin',
       pass: 'admin',