|
|
@@ -19,12 +19,10 @@ import (
|
|
|
"fohow.com/apps/helpers"
|
|
|
"fohow.com/apps/models/address_model"
|
|
|
"fohow.com/apps/models/balance_model"
|
|
|
- "fohow.com/apps/models/merchant_model"
|
|
|
"fohow.com/apps/models/order_model"
|
|
|
"fohow.com/apps/models/pay_model"
|
|
|
"fohow.com/apps/models/product_model"
|
|
|
"fohow.com/apps/models/user_model"
|
|
|
- "fohow.com/libs/tool"
|
|
|
"fohow.com/libs/wx_mp"
|
|
|
"strings"
|
|
|
"sync"
|
|
|
@@ -287,6 +285,7 @@ func (self *PayController) payExchange(oId, payWay, returnUrl, source, remark st
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
total_weixin = tp - paiedDis
|
|
|
|
|
|
//抵扣佣金
|
|
|
@@ -298,6 +297,8 @@ func (self *PayController) payExchange(oId, payWay, returnUrl, source, remark st
|
|
|
paiedCash = total_weixin
|
|
|
}
|
|
|
|
|
|
+ total_weixin = total_weixin - paiedCash
|
|
|
+
|
|
|
//特殊促销期间券不够不允许支付
|
|
|
if sys_config.GetShutWechatPromotion() && total_weixin > 0 {
|
|
|
if quanLittle {
|
|
|
@@ -612,23 +613,6 @@ func (self *PayController) payCentExchange(oId, returnUrl, source, remark string
|
|
|
self.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-//用户支付成功,后给卖家所有管理员发下单通知
|
|
|
-func CreateOrderNotify(order *order_model.Order, product *product_model.Product) {
|
|
|
- merchantUserList := merchant_model.GetMerchantUserRelationListByMerchantId(product.MerchantId, true)
|
|
|
- for _, item := range merchantUserList {
|
|
|
- if item == nil {
|
|
|
- continue
|
|
|
- }
|
|
|
- isManageTheProduct, _ := tool.Contain(fmt.Sprintf("%d", product.Id), strings.Split(item.ManageProductIds, ","))
|
|
|
- if item.ManageProductIds == "0" || isManageTheProduct {
|
|
|
- sellerWxUser := user_model.GetWxUserByUserId(item.UserId, true)
|
|
|
- if sellerWxUser != nil {
|
|
|
- helpers.OrderCreateNotify(*sellerWxUser, order.CreatedAt, product.Name, order.OrderId, "您有新的商品订单,请及时处理发货。", order_model.STATUS_CN_TEXT[order.Status], order.Count, fmt.Sprintf("pages/start/start?url=packageMerchant/pages/merchant/orders/orders&id=%d", item.MerchantId))
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
//获取库存不足商品
|
|
|
func FindNotEnoughPrd(storeMap map[int64]int64) (bool, string) {
|
|
|
//判断商品库存
|