|
|
@@ -28,7 +28,7 @@ var createDrawCode sync.Mutex
|
|
|
var payOrder sync.Mutex
|
|
|
|
|
|
//支付订单
|
|
|
-func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source string) {
|
|
|
+func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source string, useCoupon bool) {
|
|
|
payOrder.Lock()
|
|
|
defer payOrder.Unlock()
|
|
|
var payUrl string
|
|
|
@@ -118,7 +118,7 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source s
|
|
|
freight = int64(0)
|
|
|
}
|
|
|
tp += freight
|
|
|
- if order.OrderType != order_model.ORDER_TYPE_SEKILL {
|
|
|
+ if order.OrderType != order_model.ORDER_TYPE_SEKILL && useCoupon {
|
|
|
if userLeftBalanceCount < tp {
|
|
|
totalCoupon = userLeftBalanceCount
|
|
|
} else {
|
|
|
@@ -157,7 +157,9 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source s
|
|
|
product := product_model.GetProductById(productId, false)
|
|
|
go order_model.SendCreate(order.OrderId, order.Id, productId, product.Price, product.Price, product.Name, int64(1))
|
|
|
}
|
|
|
-
|
|
|
+ //已支付订单移除未支付队列
|
|
|
+ cancelKey := helpers.GetOrderCancelList()
|
|
|
+ helpers.ThrowOutRedisList(cancelKey, order.OrderId)
|
|
|
//更新已售数量
|
|
|
go order_model.UpdateSaleNums(SaleNumsMap)
|
|
|
//go CreateOrderNotify(order, product)
|
|
|
@@ -170,6 +172,7 @@ func (self *PayController) payExchange(oId, payWay, tradPwd, returnUrl, source s
|
|
|
|
|
|
wxUser := self.GetCurrentWxUser(false)
|
|
|
order.Contact = address.Contact
|
|
|
+ order.PaiedPrice = total_price - totalCoupon
|
|
|
order.Tel = address.Tel
|
|
|
order.Address = fmt.Sprintf("%s%s%s%s", address.Province, address.City, address.District, address.Address)
|
|
|
order.Source = source
|