q-koa 10.5.2 → 10.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/app.js CHANGED
@@ -366,12 +366,12 @@ class APP {
366
366
  const db = connectDatabase(dbName)(this.config.db)
367
367
  if (!is_dev) {
368
368
  if (!dbFlag) {
369
- console.log(chalk.green(`检查${dbName}数据库`))
369
+ console.log(chalk.green(`${appName}检查数据库${dbName}`))
370
370
  await db.authenticate()
371
371
  dbFlag = true
372
372
  }
373
373
  } else {
374
- console.log(chalk.green(`检查${dbName}数据库`))
374
+ console.log(chalk.green(`${appName}检查数据库${dbName}`))
375
375
  await db.authenticate()
376
376
  }
377
377
  const configPath = `${rootDirectory}/${APP_DIR}/${appName}/config.js`
@@ -1202,6 +1202,8 @@ exports.refund = async (ctx) => {
1202
1202
  config = 'weixin_mp',
1203
1203
  pay_config = 'weixin_pay',
1204
1204
  is_new_pay = false,
1205
+ out_trade_no,
1206
+ type,
1205
1207
  } = ctx.request.body
1206
1208
 
1207
1209
  const fn = is_new_pay ? 'refund_new' : 'refund'
@@ -1214,6 +1216,8 @@ exports.refund = async (ctx) => {
1214
1216
  price,
1215
1217
  config,
1216
1218
  pay_config,
1219
+ out_trade_no,
1220
+ type,
1217
1221
  })
1218
1222
  ctx.SUCCESS('ok')
1219
1223
  }
@@ -13,7 +13,7 @@ exports.refund = async ({
13
13
  total_fee,
14
14
  refund_fee,
15
15
  price,
16
- type = '',
16
+ type = 'MP-WEIXIN',
17
17
  config = 'weixin_mp',
18
18
  pay_config = 'weixin_pay',
19
19
  out_trade_no: _out_trade_no,
@@ -41,8 +41,8 @@ exports.refund = async ({
41
41
  const out_trade_no = _out_trade_no
42
42
  ? _out_trade_no
43
43
  : prefix
44
- ? `${key}_${prefix}-${id}_MP-WEIXIN`
45
- : `${key}_${id}_MP-WEIXIN`
44
+ ? `${key}_${prefix}-${id}_${type}`
45
+ : `${key}_${id}_${type}`
46
46
  const orderDetail = await app.model[orderModel].findOne({
47
47
  where: {
48
48
  id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.5.2",
3
+ "version": "10.5.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {