- SkuCategory下添加调价比例:JdPricePercentage,EbaiPricePercentage,MtwmPricePercentage

This commit is contained in:
gazebo
2019-05-15 16:02:23 +08:00
parent 5c436326bf
commit a3aabcf8a8
8 changed files with 55 additions and 18 deletions

View File

@@ -54,7 +54,8 @@ type tStoreSkuFullInfo struct {
EbaiCat2ID int64 `orm:"column(ebai_cat2_id)"`
EbaiCat3ID int64 `orm:"column(ebai_cat3_id)"`
PricePercentage int
PricePercentage int
CatPricePercentage int
}
type tStoreCatInfo struct {
@@ -82,7 +83,7 @@ func (p *PurchaseHandler) getDirtyStoreSkus(db *dao.DaoDB, storeID int, skuIDs [
sql := `
SELECT t8.price_percentage, t1.*, t2.id sku_id, t2.spec_quality, t2.spec_unit, t2.weight, t2.status sku_status,
t3.id name_id, t3.prefix, t3.name, t2.comment, t3.is_global, t3.unit, IF(t3.img_ebai <> '', t3.img_ebai, t3.img) img, t3.upc,
t4.name cat_name,
t4.name cat_name, t4.ebai_price_percentage cat_price_percentage,
t4.id cat_id, t4.level cat_level, t5.ebai_id cat_ebai_id,
t4p.id parent_cat_id, t5p.ebai_id parent_cat_ebai_id, t5p.ebai_sync_status parent_cat_ebai_sync_status,
cat1.vendor_category_id ebai_cat3_id, cat2.vendor_category_id ebai_cat2_id, cat2.parent_id ebai_cat1_id
@@ -385,7 +386,7 @@ func (p *PurchaseHandler) RefreshStoresAllSkusID(ctx *jxcontext.Context, parentT
///////////
func genSkuParamsFromStoreSkuInfo(storeSku *tStoreSkuFullInfo) (params map[string]interface{}) {
price := jxutils.CaculateSkuVendorPrice(storeSku.Price, storeSku.PricePercentage)
price := jxutils.CaculateSkuVendorPrice(storeSku.Price, storeSku.PricePercentage, storeSku.CatPricePercentage)
params = map[string]interface{}{
"name": jxutils.ComposeSkuName(storeSku.Prefix, storeSku.Name, storeSku.Comment, storeSku.Unit, storeSku.SpecQuality, storeSku.SpecUnit, 0),
"left_num": model.MaxStoreSkuStockQty,