Merge branch 'master' into mark

This commit is contained in:
gazebo
2019-12-17 10:07:13 +08:00
4 changed files with 13 additions and 12 deletions

View File

@@ -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,

View File

@@ -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 {

View File

@@ -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"`
@@ -1195,12 +1195,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

View File

@@ -133,7 +133,7 @@ type OrderSku struct {
ID int64 `orm:"column(id)" json:"-"`
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
StoreSubID int `orm:"column(store_sub_id)" json:"storeSubID"` // 当前这个字段被当成结算活动ID用
StoreSubID int `orm:"column(store_sub_id)" json:"storeSubID"` // EarningActID当前这个字段被当成结算活动ID用
StoreSubName string `orm:"size(64)" json:"storeSubName"` // 当前这个字段被用作vendorActType
Count int `json:"count"`
VendorSkuID string `orm:"column(vendor_sku_id);size(48)" json:"vendorSkuID"`