修改代码
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/scheduler"
|
||||
"git.rosy.net.cn/jx-callback/business/util"
|
||||
"git.rosy.net.cn/jx-callback/legacy/freshfood"
|
||||
)
|
||||
|
||||
@@ -198,24 +197,20 @@ func (c *OrderController) GetOrder(orderID string) (order *model.GoodsOrder, err
|
||||
}
|
||||
|
||||
func setOrederDetailFee(result map[string]interface{}, order *model.GoodsOrder) {
|
||||
var skuTotalPmFee, orderPmFee, skuTotalPmSubsidy, orderPmSubsidy int64
|
||||
orderActivities := result["orderActivities"].([]interface{})
|
||||
for _, value := range orderActivities {
|
||||
activity := value.(map[string]interface{})
|
||||
categoryId := utils.MustInterface2Int64(activity["categoryId"])
|
||||
isHave, _ := util.ContainForInt64Arry(categoryId, model.ElmSkuPromotion)
|
||||
if isHave == true {
|
||||
skuTotalPmFee += -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["restaurantPart"]))
|
||||
skuTotalPmSubsidy += -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["elemePart"]))
|
||||
restaurantPart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["restaurantPart"]))
|
||||
elemePart := -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["elemePart"]))
|
||||
if _, isHave := model.ElmSkuPromotion[int(categoryId)]; isHave {
|
||||
order.SkuPmFee += restaurantPart
|
||||
order.SkuPmSubsidy += elemePart
|
||||
} else {
|
||||
orderPmFee += -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["restaurantPart"]))
|
||||
orderPmSubsidy += -jxutils.StandardPrice2Int(utils.MustInterface2Float64(activity["elemePart"]))
|
||||
order.OrderPmFee += restaurantPart
|
||||
order.OrderPmSubsidy += elemePart
|
||||
}
|
||||
}
|
||||
order.SkuPmSubsidy = skuTotalPmSubsidy
|
||||
order.SkuPmFee = skuTotalPmFee
|
||||
order.OrderPmFee = orderPmFee
|
||||
order.OrderPmSubsidy = orderPmSubsidy
|
||||
order.PlatformFeeRate = int16(utils.MustInterface2Float64(result["serviceRate"]))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user