京东商城开关
This commit is contained in:
@@ -595,7 +595,8 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric
|
|||||||
t1.ex_prefix,
|
t1.ex_prefix,
|
||||||
t1.ex_prefix_begin,
|
t1.ex_prefix_begin,
|
||||||
t1.ex_prefix_end,
|
t1.ex_prefix_end,
|
||||||
t1.yb_name_suffix
|
t1.yb_name_suffix,
|
||||||
|
t1.jds_stock_switch
|
||||||
`
|
`
|
||||||
if isQueryMidPrice {
|
if isQueryMidPrice {
|
||||||
sql += `,
|
sql += `,
|
||||||
@@ -635,6 +636,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric
|
|||||||
t1.ex_prefix_begin,
|
t1.ex_prefix_begin,
|
||||||
t1.ex_prefix_end,
|
t1.ex_prefix_end,
|
||||||
t1.yb_name_suffix,
|
t1.yb_name_suffix,
|
||||||
|
t1.jds_stock_switch,
|
||||||
`
|
`
|
||||||
if isQueryMidPrice {
|
if isQueryMidPrice {
|
||||||
sqlData += " t4.mid_unit_price,"
|
sqlData += " t4.mid_unit_price,"
|
||||||
|
|||||||
@@ -231,12 +231,13 @@ func storeSkuSyncInfo2Bare(inSku *dao.StoreSkuSyncInfo) (outSku *partner.StoreSk
|
|||||||
NameID: inSku.NameID,
|
NameID: inSku.NameID,
|
||||||
VendorNameID: inSku.VendorNameID,
|
VendorNameID: inSku.VendorNameID,
|
||||||
|
|
||||||
Status: inSku.MergedStatus,
|
Status: inSku.MergedStatus,
|
||||||
VendorPrice: inSku.VendorPrice,
|
VendorPrice: inSku.VendorPrice,
|
||||||
Seq: inSku.Seq,
|
Seq: inSku.Seq,
|
||||||
JxPrice: inSku.Price,
|
JxPrice: inSku.Price,
|
||||||
JxUnitPrice: inSku.UnitPrice,
|
JxUnitPrice: inSku.UnitPrice,
|
||||||
VendorSkuID2: utils.Int64ToStr(inSku.JdsWareID),
|
VendorSkuID2: utils.Int64ToStr(inSku.JdsWareID),
|
||||||
|
JdsStockSwitch: inSku.JdsStockSwitch,
|
||||||
}
|
}
|
||||||
if !isStoreSkuSyncNeedDelete(inSku) {
|
if !isStoreSkuSyncNeedDelete(inSku) {
|
||||||
outSku.Stock = model.MaxStoreSkuStockQty
|
outSku.Stock = model.MaxStoreSkuStockQty
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ type StoreSkuSyncInfo struct {
|
|||||||
NameCategoryID int `orm:"column(name_category_id)"`
|
NameCategoryID int `orm:"column(name_category_id)"`
|
||||||
YbNameSuffix string //银豹的商品条码后缀
|
YbNameSuffix string //银豹的商品条码后缀
|
||||||
YbBarCode string //银豹的商品条码
|
YbBarCode string //银豹的商品条码
|
||||||
|
JdsStockSwitch string
|
||||||
|
|
||||||
// 平台相关的图片信息
|
// 平台相关的图片信息
|
||||||
Img string
|
Img string
|
||||||
@@ -403,6 +404,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
|||||||
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id,
|
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id,
|
||||||
t2.*,
|
t2.*,
|
||||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.ex_prefix, t3.ex_prefix_begin, t3.ex_prefix_end, t3.category_id name_category_id, t3.yb_name_suffix,
|
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.ex_prefix, t3.ex_prefix_begin, t3.ex_prefix_end, t3.category_id name_category_id, t3.yb_name_suffix,
|
||||||
|
t3.jds_stock_switch,
|
||||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||||
IF(t13.%s <> '', t13.%s, t3.desc_img) desc_img,
|
IF(t13.%s <> '', t13.%s, t3.desc_img) desc_img,
|
||||||
|
|||||||
@@ -46,12 +46,13 @@ type StoreSkuInfo struct {
|
|||||||
|
|
||||||
Seq int `json:"seq,omitempty"`
|
Seq int `json:"seq,omitempty"`
|
||||||
|
|
||||||
ActPrice int64 `json:"actPrice,omitempty"`
|
ActPrice int64 `json:"actPrice,omitempty"`
|
||||||
VendorActID string `json:"vendorActID,omitempty"`
|
VendorActID string `json:"vendorActID,omitempty"`
|
||||||
IsSpecialty int `json:"isSpecialty,omitempty"`
|
IsSpecialty int `json:"isSpecialty,omitempty"`
|
||||||
JxPrice int64 `json:"jxPrice,omitempty"`
|
JxPrice int64 `json:"jxPrice,omitempty"`
|
||||||
JxUnitPrice int64 `json:"jxUnitPrice,omitempty"`
|
JxUnitPrice int64 `json:"jxUnitPrice,omitempty"`
|
||||||
VendorSkuID2 string `json:"vendorSkuID2,omitempty"`
|
VendorSkuID2 string `json:"vendorSkuID2,omitempty"`
|
||||||
|
JdsStockSwitch int `json:"jdsStockSwitch"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StoreSkuInfoWithErr struct {
|
type StoreSkuInfoWithErr struct {
|
||||||
|
|||||||
@@ -244,6 +244,9 @@ func (p *PurchaseHandler) UpdateStoreSkusStatus(ctx *jxcontext.Context, vendorOr
|
|||||||
stock = 9999
|
stock = 9999
|
||||||
}
|
}
|
||||||
if storeID == model.JdShopMainStoreID {
|
if storeID == model.JdShopMainStoreID {
|
||||||
|
if v.JdsStockSwitch == model.NO {
|
||||||
|
stock = 0
|
||||||
|
}
|
||||||
err = api.JdShopAPI.UpdateSkuStock(utils.Str2Int(v.VendorSkuID), stock)
|
err = api.JdShopAPI.UpdateSkuStock(utils.Str2Int(v.VendorSkuID), stock)
|
||||||
} else {
|
} else {
|
||||||
storeSkus, err2 := dao.GetStoresSkusInfo(dao.GetDB(), []int{model.JdShopMainStoreID}, []int{v.SkuID})
|
storeSkus, err2 := dao.GetStoresSkusInfo(dao.GetDB(), []int{model.JdShopMainStoreID}, []int{v.SkuID})
|
||||||
|
|||||||
Reference in New Issue
Block a user