Browse Source

增加系统配置接口

kobe6258 4 months ago
parent
commit
a3c6320403
2 changed files with 9 additions and 9 deletions
  1. 8 8
      controllers/order.go
  2. 1 1
      models/product_order.go

+ 8 - 8
controllers/order.go

@@ -373,7 +373,7 @@ func (this *OrderController) TradeOrderList() {
 				RealName:       productOrder.RealName,
 				Mobile:         fmt.Sprintf("+%s %s", productOrder.AreaCode, productOrder.Mobile),
 				ProductName:    productOrder.ProductName,
-				Amount:         order.Amount,
+				Amount:         fmt.Sprintf("¥%s", order.Amount),
 				TransactionID:  order.TransactionId,
 				ProductOrderID: order.ProductOrderId,
 				PaymentWay:     PaymentWayMap[order.PaymentWay],
@@ -507,23 +507,23 @@ func (this *OrderController) ExportProductOrder() {
 		br.ErrMsg = "导出商品订单失败,Err:" + err.Error()
 		return
 	}
-	var ListView []models.ProductOrderView
+	var ListView []*models.ProductOrderView
 	var wg sync.WaitGroup
 	for _, orderItem := range List {
-		go func(orderItem models.ProductOrder) {
+		go func(orderItem *models.ProductOrder) {
 			defer wg.Done()
-			view := models.ProductOrderView{
+			view := &models.ProductOrderView{
 				OrderID:       orderItem.OrderId,
 				RealName:      orderItem.RealName,
 				Mobile:        fmt.Sprintf("+%s %s", orderItem.AreaCode, orderItem.Mobile),
 				ProductType:   ProductTypeMap[orderItem.ProductType],
 				ProductName:   orderItem.ProductName,
-				TotalAmount:   orderItem.TotalAmount,
+				TotalAmount:   fmt.Sprintf("¥%s", orderItem.TotalAmount),
 				TradeNO:       orderItem.TradeNo,
 				RefundAmount:  orderItem.RefundAmount,
 				RefundTradeId: orderItem.RefundTradeId,
 				PaymentWay:    PaymentWayMap[orderItem.PaymentWay],
-				PaymentAmount: orderItem.PaymentAmount,
+				PaymentTime:   orderItem.PaymentTime.Format(time.DateTime),
 				Status:        ProductOrderStatus[orderItem.Status],
 				RefundStatus:  RefundStatusMap[orderItem.RefundStatus],
 				Remark:        orderItem.Remark,
@@ -535,7 +535,7 @@ func (this *OrderController) ExportProductOrder() {
 				if tradeErr != nil {
 					utils.FileLog.Error("获取支付订单失败,支付订单号:" + orderItem.TradeNo + ",err:" + tradeErr.Error())
 				} else {
-					view.PaymentAmount = fmt.Sprintf("%s %.2f", tradeOrder.Currency, tradeOrder.Amount)
+					view.PaymentAmount = fmt.Sprintf("%s", tradeOrder.Amount)
 				}
 			}
 			if orderItem.Status == models.OrderStatusPaid {
@@ -656,7 +656,7 @@ func (this *OrderController) ExportTradeOrder() {
 				RealName:       productOrder.RealName,
 				Mobile:         fmt.Sprintf("+%s %s", productOrder.AreaCode, productOrder.Mobile),
 				ProductName:    productOrder.ProductName,
-				Amount:         order.Amount,
+				Amount:         fmt.Sprintf("¥%s", order.Amount),
 				TransactionID:  order.TransactionId,
 				ProductOrderID: order.ProductOrderId,
 				PaymentWay:     PaymentWayMap[order.PaymentWay],

+ 1 - 1
models/product_order.go

@@ -94,7 +94,7 @@ func GetProductOrderByCondition(condition string, sortCondition string, startSiz
 	_, err = o.Raw(sql, startSize, pageSize).QueryRows(&list)
 	return
 }
-func GetProductOrderListByCondition(condition string, sortCondition string) (list []ProductOrder, err error) {
+func GetProductOrderListByCondition(condition string, sortCondition string) (list []*ProductOrder, err error) {
 	o := orm.NewOrm()
 	sql := `select * from product_orders where is_deleted=0`
 	if condition != "" {