q-koa 7.8.0 → 7.8.3

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
@@ -1472,11 +1472,15 @@ class APP {
1472
1472
  if (omit.length === 0) {
1473
1473
  ctx.SUCCESS(result)
1474
1474
  } else {
1475
- ctx.SUCCESS(
1476
- result.map((target) => {
1477
- return _.omit(target.toJSON(), omit)
1478
- })
1479
- )
1475
+ if (['findAndCountAll', 'findAll'].includes(fn)) {
1476
+ ctx.SUCCESS(
1477
+ result.map((target) => {
1478
+ return _.omit(target.toJSON(), omit)
1479
+ })
1480
+ )
1481
+ } else {
1482
+ ctx.SUCCESS(_.omit(result.toJSON(), omit))
1483
+ }
1480
1484
  }
1481
1485
  } else {
1482
1486
  const rows = await app[appName].model[controller][fn]({
@@ -956,12 +956,14 @@ exports.refund_notify = async (ctx) => {
956
956
  const prefix =
957
957
  out_trade_no.split('_').length === 4 ? out_trade_no.split('_')[1] : ''
958
958
 
959
- const order_id = out_trade_no.includes('_')
960
- ? Number(out_trade_no.split('_')[0])
961
- : Number(out_trade_no)
962
- const type = out_trade_no.includes('_') ? out_trade_no.split('_')[1] : ''
959
+ const order_id = out_refund_no.includes('_')
960
+ ? Number(out_refund_no.split('_')[0])
961
+ : Number(out_refund_no)
962
+ const type = out_refund_no.includes('_') ? out_refund_no.split('_')[1] : ''
963
963
  const model = prefix ? `${prefix}_order` : 'order'
964
- console.log(out_refund_no, '微信支付回调-----', type, model)
964
+ console.log(
965
+ `微信退款回调 prefix:${prefix}/model:${model}/order_id:${order_id}/type:${type}`
966
+ )
965
967
  if (app.service[model] && app.service[model].refund_notify) {
966
968
  await app.service[model].refund_notify({
967
969
  app,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "7.8.0",
3
+ "version": "7.8.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {