xingzai 1 an în urmă
părinte
comite
0fed57345b
1 a modificat fișierele cu 14 adăugiri și 1 ștergeri
  1. 14 1
      controllers/wechat.go

+ 14 - 1
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,11 +486,23 @@ 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)
 	}
+
+	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
 	br.Success = true