Browse Source

no message

xingzai 11 months ago
parent
commit
3a591b9c9b
4 changed files with 32 additions and 2 deletions
  1. 1 0
      models/order/order.go
  2. 15 1
      models/order/order_user_card.go
  3. 15 1
      models/order/order_virtual_asset.go
  4. 1 0
      services/order.go

+ 1 - 0
models/order/order.go

@@ -45,6 +45,7 @@ type CygxOrder struct {
 	OrderCode        string    `comment:"订单编号"`
 	OutTradeCode     string    `comment:"外部交易号"`
 	PaymentType      int       `comment:"支付类型。取值范围:1微信支付,2支付宝支付。"`
+	TradeType        string    `comment:"交易类型,枚举值:JSAPI:公众号支付 、 NATIVE:扫码支付 、 App:App支付 、 MICROPAY:付款码支付 、 MWEB:H5支付 、 FACEPAY:刷脸支付"`
 	GoodsName        string    `comment:"商品名称"`
 	GoodsId          int       `comment:"商品ID"`
 	BuyerInvoice     string    `comment:"买家发票信息"`

+ 15 - 1
models/order/order_user_card.go

@@ -63,7 +63,20 @@ func AddCygxOrderUserCard(item *CygxOrderUserCard, itemOrder *CygxOrder) (err er
 
 	itemOrderAction := new(CygxOrderAction)
 
-	itemOrderAction.Action = "微信小程序已支付"
+	switch itemOrder.TradeType {
+	case "JSAPI":
+		itemOrderAction.Action = "公众号支付"
+	case "NATIVE":
+		itemOrderAction.Action = "扫码支付"
+	case "App":
+		itemOrderAction.Action = "App支付"
+	case "MICROPAY":
+		itemOrderAction.Action = "付款码支付"
+	case "MWEB":
+		itemOrderAction.Action = "H5支付"
+	case "FACEPAY":
+		itemOrderAction.Action = "刷脸支付"
+	}
 	itemOrderAction.OrderStatus = 2
 	itemOrderAction.OrderStatusText = "已支付"
 	itemOrderAction.OrderCode = item.OrderCode
@@ -87,6 +100,7 @@ func AddCygxOrderUserCard(item *CygxOrderUserCard, itemOrder *CygxOrder) (err er
 	updateParams["StartDate"] = item.StartDate
 	updateParams["EndDate"] = item.EndDate
 	updateParams["PaymentType"] = 1
+	updateParams["TradeType"] = itemOrder.TradeType
 	ptrStructOrTableName := "cygx_order"
 	whereParam := map[string]interface{}{"order_code": itemOrder.OrderCode}
 	qs := o.QueryTable(ptrStructOrTableName)

+ 15 - 1
models/order/order_virtual_asset.go

@@ -42,7 +42,20 @@ func AddCygxOrderVirtualAsset(item *CygxOrderVirtualAsset, itemOrder *CygxOrder)
 
 	itemOrderAction := new(CygxOrderAction)
 
-	itemOrderAction.Action = "微信小程序已支付"
+	switch itemOrder.TradeType {
+	case "JSAPI":
+		itemOrderAction.Action = "公众号支付"
+	case "NATIVE":
+		itemOrderAction.Action = "扫码支付"
+	case "App":
+		itemOrderAction.Action = "App支付"
+	case "MICROPAY":
+		itemOrderAction.Action = "付款码支付"
+	case "MWEB":
+		itemOrderAction.Action = "H5支付"
+	case "FACEPAY":
+		itemOrderAction.Action = "刷脸支付"
+	}
 	itemOrderAction.OrderStatus = 2
 	itemOrderAction.OrderStatusText = "已支付"
 	itemOrderAction.OrderCode = item.OrderCode
@@ -64,6 +77,7 @@ func AddCygxOrderVirtualAsset(item *CygxOrderVirtualAsset, itemOrder *CygxOrder)
 	updateParams["OutTradeCode"] = itemOrder.OutTradeCode
 	updateParams["ModifyTime"] = item.ModifyTime
 	updateParams["PaymentType"] = 1
+	updateParams["TradeType"] = itemOrder.TradeType
 	ptrStructOrTableName := "cygx_order"
 	whereParam := map[string]interface{}{"order_code": itemOrder.OrderCode}
 	qs := o.QueryTable(ptrStructOrTableName)

+ 1 - 0
services/order.go

@@ -116,6 +116,7 @@ func HandleOrderHandle(itemCallback *Transaction) {
 	itemOrder.PayMoney = float64(float64(itemCallback.Amount.PayerTotal) / 100) // 金额分转换处理
 	itemOrder.OrderStatus = 2
 	itemOrder.OutTradeCode = itemCallback.TransactionId
+	itemOrder.TradeType = itemCallback.TradeType
 
 	//文章处理逻辑  	OrderType        int       `comment:"订单类型,1:畅读卡订单,2:单场付费订单"`
 	if orderDetail.OrderType == 1 {