From 9e1ec73200b845edd22a03cc990bf5679fcea35b Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 17 Dec 2019 09:35:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4realEarningPrice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/orderman_ext.go | 3 +-- business/model/api.go | 8 ++++---- business/model/dao/store_sku.go | 12 +++++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/business/jxcallback/orderman/orderman_ext.go b/business/jxcallback/orderman/orderman_ext.go index 39c6b15d3..9f6b8a538 100644 --- a/business/jxcallback/orderman/orderman_ext.go +++ b/business/jxcallback/orderman/orderman_ext.go @@ -96,8 +96,7 @@ func (c *OrderManager) GetOrderSkuInfo(ctx *jxcontext.Context, vendorOrderID str t1.sku_name, IF(t1.shop_price = 0, t1.sale_price, t1.shop_price) shop_price, t1.sale_price, - t1.earning_price, - CAST(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t5.pay_percentage > 0, t5.pay_percentage, ?) / 100) AS SIGNED) real_earning_price, + CAST(IF(t1.earning_price <> 0, t1.earning_price, IF(t1.shop_price <> 0 && t1.shop_price < t1.sale_price, t1.shop_price, t1.sale_price) * IF(t5.pay_percentage > 0, t5.pay_percentage, ?) / 100) AS SIGNED) earning_price, t1.weight, t1.sku_type, t1.promotion_type, diff --git a/business/model/api.go b/business/model/api.go index 4e2d1c2c8..68981b9c9 100644 --- a/business/model/api.go +++ b/business/model/api.go @@ -45,10 +45,10 @@ type GoodsOrderExt struct { type OrderSkuExt struct { OrderSku - NameID int `orm:"column(name_id)" json:"nameID"` - FullSkuName string `json:"fullSkuName"` - Image string `json:"image"` - RealEarningPrice int64 `json:"realEarningPrice"` // 实际单品结算给门店老板钱 + NameID int `orm:"column(name_id)" json:"nameID"` + FullSkuName string `json:"fullSkuName"` + Image string `json:"image"` + // RealEarningPrice int64 `json:"realEarningPrice"` // 实际单品结算给门店老板钱 } type GoodsOrderCountInfo struct { diff --git a/business/model/dao/store_sku.go b/business/model/dao/store_sku.go index 5e4699a9d..6e2ba7a41 100644 --- a/business/model/dao/store_sku.go +++ b/business/model/dao/store_sku.go @@ -176,7 +176,7 @@ type StoreSkuExt struct { EarningPrice int `json:"earningPrice"` EarningActID int `orm:"column(earning_act_id)" json:"earningActID"` - RealEarningPrice int `json:"realEarningPrice"` + // RealEarningPrice int `json:"realEarningPrice"` StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围 StatusSaleEnd int16 `json:"statusSaleEnd"` @@ -1137,12 +1137,14 @@ func UpdateActPrice4StoreSkuNameNew(db *DaoDB, storeIDs, skuIDs []int, skuNamesI if actStoreSku := actStoreSkuMap4EarningPrice.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil { v.EarningPrice = int(actStoreSku.EarningPrice) v.EarningActID = actStoreSku.ActID + } else { + v.EarningPrice = int(jxutils.CaculateSkuEarningPrice(int64(v.BindPrice), int64(v.BindPrice), skuName.PayPercentage)) } - v.RealEarningPrice = v.EarningPrice - if v.RealEarningPrice == 0 { - v.RealEarningPrice = int(jxutils.CaculateSkuEarningPrice(int64(v.BindPrice), int64(v.BindPrice), skuName.PayPercentage)) - } + // v.RealEarningPrice = v.EarningPrice + // if v.RealEarningPrice == 0 { + // v.RealEarningPrice = int(jxutils.CaculateSkuEarningPrice(int64(v.BindPrice), int64(v.BindPrice), skuName.PayPercentage)) + // } } } else { skuName.UnitPrice = skuName.Price