ソースを参照

增加系统配置接口

kobe6258 4 ヶ月 前
コミット
26e302885d
2 ファイル変更10 行追加14 行削除
  1. 6 14
      controllers/order.go
  2. 4 0
      models/trade_order.go

+ 6 - 14
controllers/order.go

@@ -367,14 +367,10 @@ func (this *OrderController) TradeOrderList() {
 	for i := 0; i < len(List); i++ {
 		go func(order *models.TradeOrder) {
 			defer wg.Done()
-			productOrder, pdErr := models.GetProductOrderByID(order.ProductOrderId)
-			if pdErr != nil {
-				utils.FileLog.Error("获取商品订单信息失败,Err:" + pdErr.Error())
-			}
 			view := &models.TradeOrderView{
-				RealName:       productOrder.RealName,
-				Mobile:         fmt.Sprintf("+%s %s", productOrder.AreaCode, productOrder.Mobile),
-				ProductName:    productOrder.ProductName,
+				RealName:       order.RealName,
+				Mobile:         fmt.Sprintf("+%s %s", order.AreaCode, order.Mobile),
+				ProductName:    order.ProductName,
 				Amount:         fmt.Sprintf("¥%s", order.Amount),
 				TransactionID:  order.TransactionId,
 				ProductOrderID: order.ProductOrderId,
@@ -650,14 +646,10 @@ func (this *OrderController) ExportTradeOrder() {
 	for i := 0; i < len(List); i++ {
 		go func(order *models.TradeOrder) {
 			defer wg.Done()
-			productOrder, pdErr := models.GetProductOrderByID(order.ProductOrderId)
-			if pdErr != nil {
-				utils.FileLog.Error("获取商品订单信息失败,Err:" + pdErr.Error())
-			}
 			view := models.TradeOrderView{
-				RealName:       productOrder.RealName,
-				Mobile:         fmt.Sprintf("+%s %s", productOrder.AreaCode, productOrder.Mobile),
-				ProductName:    productOrder.ProductName,
+				RealName:       order.RealName,
+				Mobile:         fmt.Sprintf("+%s %s", order.AreaCode, order.Mobile),
+				ProductName:    order.ProductName,
 				Amount:         fmt.Sprintf("¥%s", order.Amount),
 				TransactionID:  order.TransactionId,
 				ProductOrderID: order.ProductOrderId,

+ 4 - 0
models/trade_order.go

@@ -24,6 +24,7 @@ type TradeOrderView struct {
 	ProductOrderID string `gorm:"column:product_order_id;size:255;default:null;comment:'商品订单号'" json:"product_order_id"`
 	PaymentAccount string `gorm:"column:payment_account;size:255;default:null;comment:'支付账号'" json:"payment_account"`
 	PaymentWay     string `gorm:"column:payment_way;type:enum('wechat');default:null;comment:'支付渠道'" json:"payment_way"`
+
 	Amount         string `gorm:"column:amount;size:20;default:null;comment:'支付金额'" json:"amount"`
 	Currency       string `gorm:"column:currency;size:255;default:null;comment:'货币'" json:"currency"`
 	MerchantID     string `gorm:"column:merchant_id;size:255;default:null;comment:'商户id'" json:"merchant_id"`
@@ -40,6 +41,9 @@ type TradeOrder struct {
 	OrgTransactionId string        `gorm:"column:org_transaction_id;size:255;default:null;comment:'原支付第三方平台ID'" json:"org_transaction_id"`
 	ProductOrderId   string        `gorm:"column:product_order_id;size:255;default:null;comment:'商品订单号'" json:"product_order_id"`
 	ProductName      string        `gorm:"column:product_name;size:255;default:null;comment:'商品名称'" json:"product_name"`
+	RealName         string        `gorm:"column:real_name;default:null;comment:'姓名'" json:"real_name"`
+	AreaCode         string        `gorm:"column:area_code;default:null;comment:'手机区号'" json:"area_code"`
+	Mobile           string        `gorm:"column:mobile;default:null;comment:'手机号'" json:"mobile"`
 	PaymentAccount   string        `gorm:"column:payment_account;size:255;default:null;comment:'支付账号'" json:"payment_account"`
 	PaymentWay       PaymentWay    `gorm:"column:payment_way;type:enum('wechat');default:null;comment:'支付渠道'" json:"payment_way"`
 	Amount           string        `gorm:"column:amount;size:20;default:null;comment:'支付金额'" json:"amount"`