Browse Source

Merge branch 'mfyx_2.0' of http://8.136.199.33:3000/cxzhang/hongze_mfyx into debug

xingzai 1 year ago
parent
commit
574399d282
1 changed files with 15 additions and 2 deletions
  1. 15 2
      controllers/wechat.go

+ 15 - 2
controllers/wechat.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"github.com/medivhzhan/weapp/v2"
 	"hongze/hongze_mfyx/models"
+	"hongze/hongze_mfyx/models/order"
 	"hongze/hongze_mfyx/services"
 	"hongze/hongze_mfyx/utils"
 	"strconv"
@@ -485,10 +486,22 @@ func (this *WechatCommonController) WxpayRefundsNotify() {
 	item.Result = string(body)
 	//fmt.Println(item.Result)
 	//return
-	go models.AddCygxShanghaiCompanyLog(item)
 	itemNotify := services.WxDecodeNotify(body)
 	if itemNotify.OutTradeNo != "" {
-		//go services.HandleOrderRefundHandle(itemNotify)
+		go services.HandleOrderRefundHandle(itemNotify)
+	}
+
+	outTradeNo := itemNotify.OutTradeNo
+	orderDetail, e := order.GetCygxOrderDetailByOrderCode(outTradeNo)
+	if e != nil {
+		return
+	}
+
+	//go AddCygxOrderPayment(itemCallback) // 记录支付交易信息
+
+	//修改过状态的不再二次处理
+	if orderDetail.OrderStatus != 3 {
+		go models.AddCygxShanghaiCompanyLog(item)
 	}
 	br.Data = itemNotify
 	br.Ret = 200