1
This commit is contained in:
@@ -175,6 +175,8 @@ func getVendorPriceFromStoreSkuBind(bind *model.StoreSkuBind, vendorID int) (ven
|
|||||||
vendorPrice = bind.EbaiPrice
|
vendorPrice = bind.EbaiPrice
|
||||||
case model.VendorIDJX:
|
case model.VendorIDJX:
|
||||||
vendorPrice = bind.JxPrice
|
vendorPrice = bind.JxPrice
|
||||||
|
case model.VendorIDDD:
|
||||||
|
vendorPrice = bind.DdPrice
|
||||||
}
|
}
|
||||||
return vendorPrice
|
return vendorPrice
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,8 +260,8 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i
|
|||||||
|
|
||||||
SetStoreCategorySyncStatus2(db, nil, []int{categoryID}, model.SyncFlagModifiedMask)
|
SetStoreCategorySyncStatus2(db, nil, []int{categoryID}, model.SyncFlagModifiedMask)
|
||||||
var skuIDs []int
|
var skuIDs []int
|
||||||
if valid["jdCategoryID"] != nil || valid["ebaiCategoryID"] != nil || valid["mtwmCategoryID"] != nil ||
|
if valid["jdCategoryID"] != nil || valid["ebaiCategoryID"] != nil || valid["mtwmCategoryID"] != nil || valid["ddCategoryID"] != nil ||
|
||||||
valid["jdPricePercentage"] != nil || valid["ebaiPricePercentage"] != nil || valid["mtwmPricePercentage"] != nil {
|
valid["jdPricePercentage"] != nil || valid["ebaiPricePercentage"] != nil || valid["mtwmPricePercentage"] != nil || valid["ddPricePercentage"] != nil {
|
||||||
if skuList, err2 := dao.GetSkuByCats(db, []int{categoryID}); err2 == nil && len(skuList) > 0 {
|
if skuList, err2 := dao.GetSkuByCats(db, []int{categoryID}); err2 == nil && len(skuList) > 0 {
|
||||||
for _, sku := range skuList {
|
for _, sku := range skuList {
|
||||||
skuIDs = append(skuIDs, sku.ID)
|
skuIDs = append(skuIDs, sku.ID)
|
||||||
@@ -291,6 +291,13 @@ func UpdateCategory(ctx *jxcontext.Context, categoryID int, payload map[string]i
|
|||||||
} else if valid["mtwmCategoryID"] != nil {
|
} else if valid["mtwmCategoryID"] != nil {
|
||||||
vendorIDs = append(vendorIDs, model.VendorIDMTWM)
|
vendorIDs = append(vendorIDs, model.VendorIDMTWM)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if valid["ddPricePercentage"] != nil {
|
||||||
|
vendorIDs = append(vendorIDs, model.VendorIDDD)
|
||||||
|
syncStatus |= model.SyncFlagPriceMask
|
||||||
|
} else if valid["ddCategoryID"] != nil {
|
||||||
|
vendorIDs = append(vendorIDs, model.VendorIDDD)
|
||||||
|
}
|
||||||
if len(vendorIDs) > 0 {
|
if len(vendorIDs) > 0 {
|
||||||
SetStoreSkuSyncStatus2(db, nil, vendorIDs, skuIDs, syncStatus)
|
SetStoreSkuSyncStatus2(db, nil, vendorIDs, skuIDs, syncStatus)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3588,6 +3588,8 @@ func vendorPriceTransForm(storeSkuExt *dao.StoreSkuExt, vendorID int) int64 {
|
|||||||
return int64(storeSkuExt.YbPrice)
|
return int64(storeSkuExt.YbPrice)
|
||||||
case 5:
|
case 5:
|
||||||
return int64(storeSkuExt.JdsPrice)
|
return int64(storeSkuExt.JdsPrice)
|
||||||
|
case 14:
|
||||||
|
return int64(storeSkuExt.DdPrice)
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ type StoreSkuExt struct {
|
|||||||
JxPrice int `json:"jxPrice"`
|
JxPrice int `json:"jxPrice"`
|
||||||
YbPrice int `json:"ybPrice"`
|
YbPrice int `json:"ybPrice"`
|
||||||
JdsPrice int `json:"jdsPrice"`
|
JdsPrice int `json:"jdsPrice"`
|
||||||
|
DdPrice int `json:"ddPrice"`
|
||||||
|
|
||||||
JdLockTime *time.Time `orm:"null" json:"jdLockTime,omitempty"`
|
JdLockTime *time.Time `orm:"null" json:"jdLockTime,omitempty"`
|
||||||
JdsLockTime *time.Time `orm:"null" json:"jdsLockTime,omitempty"`
|
JdsLockTime *time.Time `orm:"null" json:"jdsLockTime,omitempty"`
|
||||||
@@ -1428,6 +1429,9 @@ func SetStoreSkuBindVendorPrice(storeSkuBind *model.StoreSkuBind, vendorID int,
|
|||||||
case model.VendorIDJX:
|
case model.VendorIDJX:
|
||||||
storeSkuBind.JxPrice = vendorPrice
|
storeSkuBind.JxPrice = vendorPrice
|
||||||
storeSkuBind.JxLockTime = pLockTime
|
storeSkuBind.JxLockTime = pLockTime
|
||||||
|
case model.VendorIDDD:
|
||||||
|
storeSkuBind.DdPrice = vendorPrice
|
||||||
|
storeSkuBind.DdLockTime = pLockTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1441,6 +1445,8 @@ func GetStoreSkuBindVendorPrice(storeSkuBind *model.StoreSkuBind, vendorID int)
|
|||||||
vendorPrice = storeSkuBind.EbaiPrice
|
vendorPrice = storeSkuBind.EbaiPrice
|
||||||
case model.VendorIDJX:
|
case model.VendorIDJX:
|
||||||
vendorPrice = storeSkuBind.JxPrice
|
vendorPrice = storeSkuBind.JxPrice
|
||||||
|
case model.VendorIDDD:
|
||||||
|
vendorPrice = storeSkuBind.DdPrice
|
||||||
}
|
}
|
||||||
return vendorPrice
|
return vendorPrice
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -576,9 +576,13 @@ type PriceReferSnapshot struct {
|
|||||||
AvgEbaiPrice int `json:"avgEbaiPrice"`
|
AvgEbaiPrice int `json:"avgEbaiPrice"`
|
||||||
MidEbaiPrice int `json:"midEbaiPrice"`
|
MidEbaiPrice int `json:"midEbaiPrice"`
|
||||||
MaxMtwmPrice int `json:"maxMtwmPrice"`
|
MaxMtwmPrice int `json:"maxMtwmPrice"`
|
||||||
|
MaxDdPrice int `json:"maxDdPrice"`
|
||||||
MinMtwmPrice int `json:"minMtwmPrice"`
|
MinMtwmPrice int `json:"minMtwmPrice"`
|
||||||
|
MinDdPrice int `json:"minDdPrice"`
|
||||||
AvgMtwmPrice int `json:"avgMtwmPrice"`
|
AvgMtwmPrice int `json:"avgMtwmPrice"`
|
||||||
|
AvgDdPrice int `json:"avgDdPrice"`
|
||||||
MidMtwmPrice int `json:"midMtwmPrice"`
|
MidMtwmPrice int `json:"midMtwmPrice"`
|
||||||
|
MidDdPrice int `json:"midDdPrice"`
|
||||||
MaxSalePrice int `json:"maxSalePrice"`
|
MaxSalePrice int `json:"maxSalePrice"`
|
||||||
MinSalePrice int `json:"minSalePrice"`
|
MinSalePrice int `json:"minSalePrice"`
|
||||||
AvgSalePrice int `json:"avgSalePrice"`
|
AvgSalePrice int `json:"avgSalePrice"`
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ type StoreSkuBind struct {
|
|||||||
// ElmID int64 `orm:"column(elm_id);index"`
|
// ElmID int64 `orm:"column(elm_id);index"`
|
||||||
MtwmID int64 `orm:"column(mtwm_id);index"`
|
MtwmID int64 `orm:"column(mtwm_id);index"`
|
||||||
EbaiID int64 `orm:"column(ebai_id);index"`
|
EbaiID int64 `orm:"column(ebai_id);index"`
|
||||||
|
DdID int64 `orm:"column(dd_id);index"`
|
||||||
YbID int64 `orm:"column(yb_id);index"`
|
YbID int64 `orm:"column(yb_id);index"`
|
||||||
JdsID int64 `orm:"column(jds_id);index"`
|
JdsID int64 `orm:"column(jds_id);index"`
|
||||||
JdsWareID int64 `orm:"column(jds_ware_id)"`
|
JdsWareID int64 `orm:"column(jds_ware_id)"`
|
||||||
@@ -123,6 +124,7 @@ type StoreSkuBind struct {
|
|||||||
// ElmSyncStatus int8 `orm:"default(2)"`
|
// ElmSyncStatus int8 `orm:"default(2)"`
|
||||||
JdSyncStatus int8 `orm:"default(2)"`
|
JdSyncStatus int8 `orm:"default(2)"`
|
||||||
MtwmSyncStatus int8 `orm:"default(2)"`
|
MtwmSyncStatus int8 `orm:"default(2)"`
|
||||||
|
DdSyncStatus int8 `orm:"default(2)"`
|
||||||
EbaiSyncStatus int8 `orm:"default(2)"`
|
EbaiSyncStatus int8 `orm:"default(2)"`
|
||||||
YbSyncStatus int8 `orm:"default(2)"`
|
YbSyncStatus int8 `orm:"default(2)"`
|
||||||
JdsSyncStatus int8 `orm:"default(2)"` //京东商城
|
JdsSyncStatus int8 `orm:"default(2)"` //京东商城
|
||||||
@@ -133,6 +135,7 @@ type StoreSkuBind struct {
|
|||||||
MtwmPrice int `json:"mtwmPrice"`
|
MtwmPrice int `json:"mtwmPrice"`
|
||||||
EbaiPrice int `json:"ebaiPrice"`
|
EbaiPrice int `json:"ebaiPrice"`
|
||||||
JxPrice int `json:"jxPrice"`
|
JxPrice int `json:"jxPrice"`
|
||||||
|
DdPrice int `json:"ddPrice"`
|
||||||
YbPrice int `json:"ybPrice"`
|
YbPrice int `json:"ybPrice"`
|
||||||
JdsPrice int `json:"jdsPrice"`
|
JdsPrice int `json:"jdsPrice"`
|
||||||
//GmPrice int `json:"gmPrice"`
|
//GmPrice int `json:"gmPrice"`
|
||||||
@@ -143,7 +146,7 @@ type StoreSkuBind struct {
|
|||||||
EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"`
|
EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"`
|
||||||
JxLockTime *time.Time `orm:"null" json:"jxLockTime"`
|
JxLockTime *time.Time `orm:"null" json:"jxLockTime"`
|
||||||
YbLockTime *time.Time `orm:"null" json:"ybLockTime"`
|
YbLockTime *time.Time `orm:"null" json:"ybLockTime"`
|
||||||
//GmLockTime *time.Time `orm:"null" json:"gmLockTime"`
|
DdLockTime *time.Time `orm:"null" json:"ddLockTime"`
|
||||||
|
|
||||||
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`
|
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user