根据平台反酸价格增加参数
This commit is contained in:
@@ -3585,7 +3585,7 @@ func SendSeckillSkusCountMsg(ctx *jxcontext.Context, vendorIDs []int, isAsync, i
|
||||
return hint, err
|
||||
}
|
||||
|
||||
func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus, vendorID int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus, vendorID int, ignoreLow, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
jdMap = make(map[int][]*JdStoreSkus)
|
||||
@@ -3650,7 +3650,16 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
|
||||
for kk, vv := range v {
|
||||
result, err := dao.GetStoreSkuBindByNameID(db, k, kk, model.SkuStatusNormal)
|
||||
if len(result) > 0 && err == nil {
|
||||
if result[0].UnitPrice > vv {
|
||||
if ignoreLow {
|
||||
if result[0].UnitPrice > vv {
|
||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||
StoreID: k,
|
||||
NameID: kk,
|
||||
UnitPrice: vv,
|
||||
}
|
||||
param = append(param, storeSkuBindInfo)
|
||||
}
|
||||
} else {
|
||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||
StoreID: k,
|
||||
NameID: kk,
|
||||
@@ -3695,7 +3704,16 @@ func RefreshJxPriceByVendor(ctx *jxcontext.Context, jdStoreSkus []*JdStoreSkus,
|
||||
for kk, vv := range v {
|
||||
result, err := dao.GetStoreSkuBindByNameID(db, k, kk, model.SkuStatusNormal)
|
||||
if len(result) > 0 && err == nil {
|
||||
if result[0].UnitPrice > vv {
|
||||
if ignoreLow {
|
||||
if result[0].UnitPrice > vv {
|
||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||
StoreID: k,
|
||||
NameID: kk,
|
||||
UnitPrice: vv,
|
||||
}
|
||||
param = append(param, storeSkuBindInfo)
|
||||
}
|
||||
} else {
|
||||
storeSkuBindInfo := &StoreSkuBindInfo{
|
||||
StoreID: k,
|
||||
NameID: kk,
|
||||
|
||||
Reference in New Issue
Block a user