diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 8721db7a8..cba833510 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -392,7 +392,11 @@ func (c *OrderManager) updateOrderSkuOtherInfo(order *model.GoodsOrder, db *dao. if v.VendorPrice == v.SalePrice { var earningPrice = 0 if v.ShopPrice < v.SalePrice { - earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.ShopPrice)) * utils.Int2Float64(storePayPercentage) / 100))) + if v.ShopPrice == 0 { + earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100))) + } else { + earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.ShopPrice)) * utils.Int2Float64(storePayPercentage) / 100))) + } } else { earningPrice = int(utils.Float64TwoInt64(math.Round(utils.Int2Float64(int(v.SalePrice)) * utils.Int2Float64(storePayPercentage) / 100))) } diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 953c57faf..cc5d3604a 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -1120,15 +1120,21 @@ func AddSku(ctx *jxcontext.Context, nameID int, sku *model.Sku, userName string) err = ErrEntityNotExist } } - // storeSkus, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, nameID) + storeSkus, err := dao.GetStoreSkusByNameIDs(db, []int{model.JdShopMainStoreID}, nameID) // if len(storeSkus) > 0 { // storeSkus2, err2 := dao.GetStoreSkusByNameIDs(db, nil, nameID) // err = err2 - // skuBindInfos := []*StoreSkuBindInfo{} + // storeIDs := make(map[int]int) // for _, v := range storeSkus2 { + // storeMaps, err := dao.GetStoresMapList(db, []int{model.VendorIDJDShop}, []int{v.StoreID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "") + + // storeIDs[v.StoreID] = v.StoreID + // } + // skuBindInfos := []*StoreSkuBindInfo{} + // for _, v := range storeIDs { // skus2 := []*StoreSkuBindSkuInfo{} // skuBindInfo := &StoreSkuBindInfo{ - // StoreID: v.StoreID, + // StoreID: v, // } // sku2 := &StoreSkuBindSkuInfo{ // SkuID: sku.ID,