|
|
@@ -187,7 +187,6 @@ func SetOrderPromotion(orderId string, wxUid int64) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//订单促销
|
|
|
/*
|
|
|
如果促销条件中,设置的项目有一项不满足即视为不满足促销条件
|
|
|
@@ -241,9 +240,9 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
nums1 = int64(0)
|
|
|
if prd != nil {
|
|
|
detail_nums1 := int64(0)
|
|
|
- detailItem:=order_model.GetDetailsByOrderIdAndPid(orderId,item.Prod1)
|
|
|
- if detailItem!=nil{
|
|
|
- detail_nums1=detailItem.Count
|
|
|
+ detailItem := order_model.GetDetailsByOrderIdAndPid(orderId, item.Prod1)
|
|
|
+ if detailItem != nil {
|
|
|
+ detail_nums1 = detailItem.Count
|
|
|
}
|
|
|
if detail_nums1 > int64(0) && item.Prod1 > 0 && item.Nums1 > 0 {
|
|
|
nums1 = int64(detail_nums1 / item.Nums1)
|
|
|
@@ -255,10 +254,10 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
prd := product_model.GetProductById(item.Prod2, true)
|
|
|
nums2 = int64(0)
|
|
|
if prd != nil {
|
|
|
- detail_nums2 :=int64(0)
|
|
|
- detailItem:=order_model.GetDetailsByOrderIdAndPid(orderId,item.Prod2)
|
|
|
- if detailItem!=nil{
|
|
|
- detail_nums2 =detailItem.Count
|
|
|
+ detail_nums2 := int64(0)
|
|
|
+ detailItem := order_model.GetDetailsByOrderIdAndPid(orderId, item.Prod2)
|
|
|
+ if detailItem != nil {
|
|
|
+ detail_nums2 = detailItem.Count
|
|
|
}
|
|
|
//detail_nums2 := order_model.GetDetailsByOrderIdAndRelatePid(orderId, prd.RelateProductId)
|
|
|
if detail_nums2 > int64(0) && item.Prod2 > 0 && item.Nums2 > 0 {
|
|
|
@@ -271,9 +270,9 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
nums3 = int64(0)
|
|
|
prd := product_model.GetProductById(item.Prod3, true)
|
|
|
if prd != nil {
|
|
|
- detail_nums3 :=int64(0)
|
|
|
- detailItem:=order_model.GetDetailsByOrderIdAndPid(orderId,item.Prod3)
|
|
|
- if detailItem!=nil{
|
|
|
+ detail_nums3 := int64(0)
|
|
|
+ detailItem := order_model.GetDetailsByOrderIdAndPid(orderId, item.Prod3)
|
|
|
+ if detailItem != nil {
|
|
|
detail_nums3 = detailItem.Count
|
|
|
}
|
|
|
//detail_nums3 := order_model.GetDetailsByOrderIdAndRelatePid(orderId, prd.RelateProductId)
|
|
|
@@ -291,8 +290,8 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
nums5 = int64(0)
|
|
|
if prd != nil {
|
|
|
detail_nums4 := int64(0)
|
|
|
- detailItem:=order_model.GetDetailsByOrderIdAndPid(orderId,item.Prod4)
|
|
|
- if detailItem!=nil{
|
|
|
+ detailItem := order_model.GetDetailsByOrderIdAndPid(orderId, item.Prod4)
|
|
|
+ if detailItem != nil {
|
|
|
detail_nums4 = detailItem.Count
|
|
|
}
|
|
|
//detail_nums4 := order_model.GetDetailsByOrderIdAndRelatePid(orderId, prd.RelateProductId)
|
|
|
@@ -306,9 +305,9 @@ func SetOrderPromotionPro(orderId string, wxUid int64) {
|
|
|
prd := product_model.GetProductById(item.Prod5, true)
|
|
|
nums6 = int64(0)
|
|
|
if prd != nil {
|
|
|
- detail_nums5:=int64(0)
|
|
|
- detailItem:=order_model.GetDetailsByOrderIdAndPid(orderId,item.Prod5)
|
|
|
- if detailItem!=nil{
|
|
|
+ detail_nums5 := int64(0)
|
|
|
+ detailItem := order_model.GetDetailsByOrderIdAndPid(orderId, item.Prod5)
|
|
|
+ if detailItem != nil {
|
|
|
detail_nums5 = detailItem.Count
|
|
|
}
|
|
|
//detail_nums5 := order_model.GetDetailsByOrderIdAndRelatePid(orderId, prd.RelateProductId)
|
|
|
@@ -714,7 +713,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, product.RoboBalancePrice, product.Name, "", "", sendNums1, order.Depart)
|
|
|
+ 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)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -725,7 +724,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, product.RoboBalancePrice, product.Name, "", "", sendNums2, order.Depart)
|
|
|
+ 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)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -737,7 +736,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, product.RoboBalancePrice, product.Name, "", "", sendNums3, order.Depart)
|
|
|
+ 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)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -749,7 +748,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, product.RoboBalancePrice, product.Name, "", "", sendNums4, order.Depart)
|
|
|
+ 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)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -760,7 +759,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, product.RoboBalancePrice, product.Name, "", "", sendNums5, order.Depart)
|
|
|
+ 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)
|
|
|
}
|
|
|
}
|
|
|
|