Merge pull request '修复退款' (#75) from fix-paytime into master

Reviewed-on: https://git.oa00.com/recook/backend_v2/pulls/75
master
杨赟 3 years ago
commit 5ee605f392

@ -483,6 +483,12 @@ func refundWithType(tx *gorm.DB, asGoods after.RecookAfterSalesGoodsModel) error
var od2 manage.RecookOrderInfoModel
mysql2.Db.First(&od2, "jcook_order_id = ?", od.JCookRootID)
asGoods.OrderTotalAmount = od2.ActualTotalAmount
} else {
totalOrderAmount := manage.RecookOrderInfoModel{}
mysql2.Db.Where("virtual_id = ?", od.VirtualID).Select("sum(actual_total_amount) as actual_total_amount").First(&totalOrderAmount)
if !totalOrderAmount.ActualTotalAmount.IsZero() && totalOrderAmount.ActualTotalAmount.Cmp(od.ActualTotalAmount) == 1 {
asGoods.OrderTotalAmount = totalOrderAmount.ActualTotalAmount
}
}
if err := wechat.Refund(&asGoods); err != nil {
return err

Loading…
Cancel
Save