2020-02-10美团要求下架所有猪肉

This commit is contained in:
gazebo
2020-02-10 14:56:39 +08:00
parent 7ba8a762fd
commit 527222a095
2 changed files with 21 additions and 9 deletions

View File

@@ -30,6 +30,13 @@ const (
var (
subSensitiveWordRegexp = regexp.MustCompile(`[^\[\]\"\}]`)
// 2020-02-10美团要求下架所有猪肉
meatCatMap = map[int]bool{
20: true,
184: true,
59: true,
}
)
func CreateStoreCategoryByStoreSku(ctx *jxcontext.Context, vendorID, storeID int, vendorStoreID string, nameIDs, skuIDs []int) (err error) {
@@ -378,6 +385,10 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
sku.VendorPrice = 0
}
sku.MergedStatus = MergeSkuSaleStatusWithStoreOpTime(sku, storeDetail, now)
// 2020-02-10美团要求下架所有猪肉
if globals.IsMainProductEnv() && vendorID == model.VendorIDMTWM && meatCatMap[sku.NameCategoryID] {
sku.MergedStatus = model.SkuStatusDontSale
}
var bareSku *partner.StoreSkuInfo
isNeedReorder := false
if isStoreSkuSyncNeedDelete(sku) {

View File

@@ -70,13 +70,14 @@ type StoreSkuSyncInfo struct {
ExPrefixBegin *time.Time
ExPrefixEnd *time.Time
// NameID int `orm:"column(name_id)"`
VendorNameID string `orm:"column(vendor_name_id)"` // 暂时无用
Name string
Unit string
Upc string
IsGlobal int8 `orm:"default(1)" json:"isGlobal"` // 是否是全部全国可见如果否的话可见性由SkuPlace决定
NameStatus int
SellCities []string
VendorNameID string `orm:"column(vendor_name_id)"` // 暂时无用
Name string
Unit string
Upc string
IsGlobal int8 `orm:"default(1)" json:"isGlobal"` // 是否是全部全国可见如果否的话可见性由SkuPlace决定
NameStatus int
SellCities []string
NameCategoryID int `orm:"column(name_category_id)"`
// 平台相关的图片信息
Img string
@@ -380,7 +381,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end,
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.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,
IF(t11.%s <> '', t11.%s, t3.img) img,
IF(t12.%s <> '', t12.%s, t3.img2) img2,
t13.%s desc_img,
@@ -500,7 +501,7 @@ func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInf
t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,
t1.store_id, t1.deleted_at bind_deleted_at,
t2.*, t2.id sku_id, t2m.vendor_thing_id vendor_sku_id,
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.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,
IF(t11.%s <> '', t11.%s, t3.img) img,
IF(t12.%s <> '', t12.%s, t3.img2) img2,
t13.%s desc_img,