瀏覽代碼

order refund --3

abiao 2 年之前
父節點
當前提交
c354430147

+ 3 - 3
go/gopath/src/fohow.com/apps/controllers/order_controller/order_controller.go

@@ -837,7 +837,7 @@ func (self *OrderController) Operate() {
 		}
 	} else if operate == order_model.OPERATE_CANCEL && o.Status == order_model.STATUS_PROCESSING {
 		//发起退款流程
-		go self.httpRequest(o.WxUserId, o.TotalPrice, o.OrderId, o.TradeNo)
+		go self.httpRequest(o.WxUserId, o.TotalPrice, o.PaiedPrice, o.OrderId, o.TradeNo)
 	}
 
 	if operate == order_model.OPERATE_CONFIRM && o.Status == order_model.STATUS_DISPATCH {
@@ -932,9 +932,9 @@ func (self *OrderController) OrderCommend() {
 	self.ServeJSON()
 }
 
-func (self *OrderController) httpRequest(wxId, total int64, orderId, transactionId string) {
+func (self *OrderController) httpRequest(wxId, total, paiedPrice int64, orderId, transactionId string) {
 
-	refund := new(order_model.OrderRefund).Create(wxId, total, orderId, transactionId)
+	refund := new(order_model.OrderRefund).Create(wxId, total, paiedPrice, orderId, transactionId)
 
 	url := "http://127.0.0.1:25565/railsadmin/order/refund/"
 

+ 2 - 1
go/gopath/src/fohow.com/apps/models/order_model/order_reund.go

@@ -32,12 +32,13 @@ func (self *OrderRefund) TableName() string {
 	return order_refunds_tablename
 }
 
-func (self *OrderRefund) Create(wxId, total int64, orderId, transactionId string) *OrderRefund {
+func (self *OrderRefund) Create(wxId, total, paiedPrice int64, orderId, transactionId string) *OrderRefund {
 	item := &OrderRefund{
 		OrderId:       orderId,
 		WxUserId:      wxId,
 		TransactionId: transactionId,
 		Total:         total,
+		RefundFee:     paiedPrice,
 		Status:        false,
 	}
 	id, err := orm.NewOrm().Insert(item)