Merge remote-tracking branch 'origin/mark' into su

This commit is contained in:
苏尹岚
2019-11-20 09:55:42 +08:00
6 changed files with 24 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ type ActStoreSkuParam struct {
model.ActStoreSku
ActualActPrice int64 `json:"actualActPrice,omitempty"` // 单品级活动用,创建活动时商品的活动价格
VendorPrice int64 `json:"vendorPrice,omitempty"` // 创建活动时的平台价格
ErrMsg string `json:"errMsg,omitempty"`
}
@@ -149,6 +150,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
jxPrice := storeSkuInfo.Price
actSkuMap.VendorPrice = int64(getVendorPriceFromStoreSkuBind(storeSkuInfo, vendorID))
v.OriginalPrice = int64(jxPrice)
v.OriginalPrice = actSkuMap.VendorPrice // 暂时返回平台价
}
var err2 error
if act.Type != model.ActSkuFake { // 非结算,要计算实际活动价格
@@ -176,6 +178,7 @@ func ActStoreSkuParam2Model(ctx *jxcontext.Context, db *dao.DaoDB, act *model.Ac
if err2 = checkDiscountValidation(act.Type, float64(actSkuMap.ActualActPrice)*100/float64(actSkuMap.VendorPrice)); err2 != nil {
v.ErrMsg = err2.Error()
v.ActualActPrice = actSkuMap.ActualActPrice
v.VendorPrice = actSkuMap.VendorPrice
wrongSkuList = append(wrongSkuList, v)
}
}

View File

@@ -72,6 +72,7 @@ type StoreSkuExt struct {
ActPrice int `json:"actPrice"`
ActID int `orm:"column(act_id)" json:"actID"`
ActType int `orm:"column(act_type)" json:"actType"`
EarningPrice int `json:"earningPrice"`
EarningActID int `orm:"column(earning_act_id)" json:"earningActID"`
@@ -568,6 +569,7 @@ func updateActPrice4StoreSkuNameNew(db *dao.DaoDB, storeIDs, skuIDs []int, skuNa
if actStoreSku := actStoreSkuMap4Act.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil {
v.ActPrice = int(actStoreSku.ActualActPrice)
v.ActID = actStoreSku.ActID
v.ActType = actStoreSku.Type
}
if actStoreSku := actStoreSkuMap4EarningPrice.GetActStoreSku(skuName.StoreID, v.SkuID, -1); actStoreSku != nil {
v.EarningPrice = int(actStoreSku.EarningPrice)

View File

@@ -275,9 +275,9 @@ func InitVendorCategory(ctx *jxcontext.Context, vendorID int, isAsync bool) (hin
}
for _, cat := range cats {
dao.WrapAddIDCULEntity(cat, ctx.GetUserName())
if err = dao.CreateEntity(db, cat); err != nil {
return nil, err
}
}
if err = dao.CreateMultiEntities(db, cats); err != nil {
return nil, err
}
dao.Commit(db)
}