Pārlūkot izejas kodu

Order QueryPayInfo

abiao 1 gadu atpakaļ
vecāks
revīzija
0ce0a08f1d

+ 8 - 4
go/gopath/src/fohow.com/apps/controllers/pay_controller/pay_exchange_controller.go

@@ -652,6 +652,10 @@ func (self *PayController) QueryPayInfo() {
 
 
 	//订单状态
 	//订单状态
 	order := order_model.GetOrderById(oId, false)
 	order := order_model.GetOrderById(oId, false)
+	if order == nil {
+		self.ReturnError(403, apps.OrderNotExist, "", nil)
+	}
+
 	if order.Status != order_model.STATUS_UNPAY {
 	if order.Status != order_model.STATUS_UNPAY {
 		self.ReturnError(403, apps.NotUnPay, "", nil)
 		self.ReturnError(403, apps.NotUnPay, "", nil)
 	}
 	}
@@ -661,6 +665,7 @@ func (self *PayController) QueryPayInfo() {
 	total_quan := int64(0)
 	total_quan := int64(0)
 	total_weixin := int64(0)
 	total_weixin := int64(0)
 	paiedSilver := int64(0)
 	paiedSilver := int64(0)
+	paiedCash := int64(0) //抵扣佣金
 	firstPay := true
 	firstPay := true
 	//店长折扣
 	//店长折扣
 	dis_amount := order.DisAmount
 	dis_amount := order.DisAmount
@@ -722,11 +727,7 @@ func (self *PayController) QueryPayInfo() {
 			}
 			}
 
 
 		}
 		}
-
 		total_weixin = total_weixin - paiedDis
 		total_weixin = total_weixin - paiedDis
-
-		//抵扣佣金
-		paiedCash := int64(0)
 		userLeftBalanceCash := balance_model.GetCashTotalBalance(wxUId)
 		userLeftBalanceCash := balance_model.GetCashTotalBalance(wxUId)
 		if userLeftBalanceCash > int64(0) && useBalance {
 		if userLeftBalanceCash > int64(0) && useBalance {
 			if userLeftBalanceCash < total_weixin && total_weixin > 0 {
 			if userLeftBalanceCash < total_weixin && total_weixin > 0 {
@@ -743,10 +744,13 @@ func (self *PayController) QueryPayInfo() {
 		paiedSilver = order.PaiedSilver
 		paiedSilver = order.PaiedSilver
 		total_quan = order.CouponPrice
 		total_quan = order.CouponPrice
 		total_weixin = order.PaiedPrice
 		total_weixin = order.PaiedPrice
+		paiedCash = order.PaiedCash
 	}
 	}
+
 	details.FirstPay = firstPay
 	details.FirstPay = firstPay
 	details.Freight = freight
 	details.Freight = freight
 	details.TotalPrice = total_price
 	details.TotalPrice = total_price
+	details.PayBalance = paiedCash
 	details.PaySilver = paiedSilver
 	details.PaySilver = paiedSilver
 	details.PayCoupon = total_quan
 	details.PayCoupon = total_quan
 	details.Discount = dis_amount
 	details.Discount = dis_amount