|
|
@@ -141,34 +141,34 @@ func SetOrderPromotion(orderId string, wxUid int64) {
|
|
|
sendNums1 := nums * item.SendNums1
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd1, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums1, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums1, order.Depart)
|
|
|
}
|
|
|
if item.SendProd2 > 0 && item.SendNums2 > 0 {
|
|
|
sendNums2 := nums * item.SendNums2
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd2, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums2, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums2, order.Depart)
|
|
|
}
|
|
|
|
|
|
if item.SendProd3 > 0 && item.SendNums3 > 0 {
|
|
|
sendNums3 := nums * item.SendNums3
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd3, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums3, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums3, order.Depart)
|
|
|
}
|
|
|
|
|
|
if item.SendProd4 > 0 && item.SendNums4 > 0 {
|
|
|
sendNums4 := nums * item.SendNums4
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd4, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums4, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums4, order.Depart)
|
|
|
}
|
|
|
|
|
|
if item.SendProd5 > 0 && item.SendNums5 > 0 {
|
|
|
sendNums5 := nums * item.SendNums5
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd5, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums5, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums5, order.Depart)
|
|
|
}
|
|
|
//赠送积分 or 代办费
|
|
|
if item.Cash > 0 {
|
|
|
@@ -346,34 +346,34 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
sendNums1 := nums * item.SendNums1
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd1, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums1, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums1, order.Depart)
|
|
|
}
|
|
|
if item.SendProd2 > 0 && item.SendNums2 > 0 {
|
|
|
sendNums2 := nums * item.SendNums2
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd2, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums2, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums2, order.Depart)
|
|
|
}
|
|
|
|
|
|
if item.SendProd3 > 0 && item.SendNums3 > 0 {
|
|
|
sendNums3 := nums * item.SendNums3
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd3, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums3, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums3, order.Depart)
|
|
|
}
|
|
|
|
|
|
if item.SendProd4 > 0 && item.SendNums4 > 0 {
|
|
|
sendNums4 := nums * item.SendNums4
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd4, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums4, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums4, order.Depart)
|
|
|
}
|
|
|
|
|
|
if item.SendProd5 > 0 && item.SendNums5 > 0 {
|
|
|
sendNums5 := nums * item.SendNums5
|
|
|
//赠送赠品1
|
|
|
product := product_model.GetProductById(item.SendProd5, true)
|
|
|
- go order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums5, order.Depart)
|
|
|
+ order_model.SendCreate(order.OrderId, order.Id, product.Id, product.Price, product.Price, product.Name, sendNums5, order.Depart)
|
|
|
}
|
|
|
//赠送积分 or 代办费
|
|
|
if item.Cash > 0 {
|
|
|
@@ -394,7 +394,7 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
if len(promotionsArr) > 0 {
|
|
|
promotions := tool.CombineInt64ToString(promotionsArr)
|
|
|
noinvoves := tool.CombineInt64ToString(noInovceArr)
|
|
|
- go order_model.UpdateOrderPromotions(promotions, noinvoves, orderId)
|
|
|
+ order_model.UpdateOrderPromotions(promotions, noinvoves, orderId)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -489,7 +489,7 @@ func BalanceOrderPromotion(orderId string, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd1, true)
|
|
|
if product != nil {
|
|
|
total := sendNums1 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums1, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums1, source, remark)
|
|
|
}
|
|
|
}
|
|
|
if item.SendProd2 > 0 && item.SendNums2 > 0 {
|
|
|
@@ -498,7 +498,7 @@ func BalanceOrderPromotion(orderId string, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd2, true)
|
|
|
if product != nil {
|
|
|
total := sendNums2 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums2, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums2, source, remark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -508,7 +508,7 @@ func BalanceOrderPromotion(orderId string, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd3, true)
|
|
|
if product != nil {
|
|
|
total := sendNums3 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums3, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums3, source, remark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -530,7 +530,7 @@ func BalanceOrderPromotion(orderId string, wxUid, depart int64) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//店长申请促销
|
|
|
+// 店长申请促销
|
|
|
func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
beego.BeeLogger.Warn("******* ShopOrderPromotion shopApplyId:%d wxUid:%d", shopApplyId, wxUid)
|
|
|
|
|
|
@@ -577,7 +577,7 @@ func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd1, true)
|
|
|
if product != nil {
|
|
|
total := sendNums1 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums1, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums1, source, remark)
|
|
|
}
|
|
|
}
|
|
|
if item.SendProd2 > 0 && item.SendNums2 > 0 {
|
|
|
@@ -586,7 +586,7 @@ func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd2, true)
|
|
|
if product != nil {
|
|
|
total := sendNums2 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums2, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums2, source, remark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -596,7 +596,7 @@ func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd3, true)
|
|
|
if product != nil {
|
|
|
total := sendNums3 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums3, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums3, source, remark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -606,7 +606,7 @@ func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd4, true)
|
|
|
if product != nil {
|
|
|
total := sendNums4 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums4, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums4, source, remark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -616,7 +616,7 @@ func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
product := product_model.GetProductById(item.SendProd5, true)
|
|
|
if product != nil {
|
|
|
total := sendNums5 * product.Price
|
|
|
- go new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums5, source, remark)
|
|
|
+ new(promotion_model.Present).CreatePresent(wxUid, product.Price, total, product.Id, sendNums5, source, remark)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -638,7 +638,7 @@ func ShopOrderPromotion(shopApplyId, wxUid, depart int64) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//赠品明细写入订单
|
|
|
+// 赠品明细写入订单
|
|
|
func PresentTransferToOrder(orderId string, wxUid int64) {
|
|
|
beego.BeeLogger.Warn("******* PresentTransferToOrder shopApplyId:%s wxUid:%d", orderId, wxUid)
|
|
|
//获取订单明细
|
|
|
@@ -662,7 +662,7 @@ func PresentTransferToOrder(orderId string, wxUid int64) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-//创建店铺申请订单
|
|
|
+// 创建店铺申请订单
|
|
|
func CreateShopApplyOrder(shopAppplyId int64) {
|
|
|
|
|
|
beego.BeeLogger.Warn("begin do shopAppply id:(%d)", shopAppplyId)
|
|
|
@@ -726,7 +726,7 @@ func CreateShopApplyOrder(shopAppplyId int64) {
|
|
|
if product != nil {
|
|
|
delOrder = false
|
|
|
total += sendNums1 * product.Price
|
|
|
- go new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums1, order.Depart)
|
|
|
+ new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums1, order.Depart)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -737,7 +737,7 @@ func CreateShopApplyOrder(shopAppplyId int64) {
|
|
|
if product != nil {
|
|
|
delOrder = false
|
|
|
total += sendNums2 * product.Price
|
|
|
- go new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums2, order.Depart)
|
|
|
+ new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums2, order.Depart)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -749,7 +749,7 @@ func CreateShopApplyOrder(shopAppplyId int64) {
|
|
|
if product != nil {
|
|
|
delOrder = false
|
|
|
total += sendNums3 * product.Price
|
|
|
- go new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums3, order.Depart)
|
|
|
+ new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums3, order.Depart)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -761,7 +761,7 @@ func CreateShopApplyOrder(shopAppplyId int64) {
|
|
|
if product != nil {
|
|
|
delOrder = false
|
|
|
total += sendNums4 * product.Price
|
|
|
- go new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums4, order.Depart)
|
|
|
+ new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums4, order.Depart)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -772,7 +772,7 @@ func CreateShopApplyOrder(shopAppplyId int64) {
|
|
|
if product != nil {
|
|
|
delOrder = false
|
|
|
total += sendNums5 * product.Price
|
|
|
- go new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums5, order.Depart)
|
|
|
+ new(order_model.OrderDetail).Create(order.OrderId, order.Id, product.Id, product.RelateProductId, product.Price, int64(0), int64(0), product.Name, "", "", sendNums5, order.Depart)
|
|
|
}
|
|
|
}
|
|
|
|