1
This commit is contained in:
@@ -653,7 +653,10 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku, isQueryMidPric
|
||||
t1.sell_point,
|
||||
t1.sell_point_times,
|
||||
t1.tiktok_attribute,
|
||||
t1.mt_attribute
|
||||
t1.mt_attribute,
|
||||
t1.qua_pictures,
|
||||
t1.qua_effective_date,
|
||||
t1.qua_approval_date
|
||||
`
|
||||
if isBySku {
|
||||
sqlData += " ,t2.id sku_id"
|
||||
@@ -819,6 +822,9 @@ func AddSkuName(ctx *jxcontext.Context, skuNameExt *model.SkuNameExt, userName s
|
||||
return nil, errors.New("不为份的SKU NAME只能有一个SKU")
|
||||
}
|
||||
}
|
||||
if skuNameExt.QuaPictures != "" && (skuNameExt.QuaEffectiveDate == 0 || skuNameExt.QuaApprovalDate == 0) {
|
||||
return nil, errors.New("当商品资质图存在时,商品资质有效期和批准日期不能为空")
|
||||
}
|
||||
|
||||
skuNameExt.Name = utils.TrimBlankChar(skuNameExt.Name)
|
||||
if hasSensitiveWord, word := CheckHasSensitiveWord(skuNameExt.Name); hasSensitiveWord {
|
||||
@@ -3485,6 +3491,9 @@ func GetSkuNamesNew(ctx *jxcontext.Context, keyword string, skuIDs, skuNameIDs [
|
||||
t1.jds_stock_switch,
|
||||
t1.preparation_time,
|
||||
t1.mt_attribute,
|
||||
t1.qua_pictures,
|
||||
t1.qua_effective_date,
|
||||
t1.qua_approval_date,
|
||||
t1.best_seller
|
||||
FROM sku_name t1
|
||||
LEFT JOIN sku t2 ON t1.id = t2.name_id AND t2.deleted_at = ?
|
||||
@@ -3527,6 +3536,9 @@ func GetSkuNamesNew(ctx *jxcontext.Context, keyword string, skuIDs, skuNameIDs [
|
||||
t1.preparation_time,
|
||||
t1.best_seller,
|
||||
t1.mt_attribute,
|
||||
t1.qua_pictures,
|
||||
t1.qua_effective_date,
|
||||
t1.qua_approval_date,
|
||||
t2.id sku_id
|
||||
FROM sku_name t1
|
||||
LEFT JOIN sku t2 ON t1.id = t2.name_id AND t2.deleted_at = ?
|
||||
|
||||
@@ -119,15 +119,18 @@ type StoreSkuSyncInfo struct {
|
||||
PreparationTime int
|
||||
LocalCategoryId int `orm:"column(local_category_id)"`
|
||||
// 平台相关的图片信息
|
||||
Img string
|
||||
Img2 string
|
||||
Img3 string
|
||||
Img4 string
|
||||
Img5 string
|
||||
DescImg string
|
||||
ImgWatermark string `json:"imgWatermark"` //图片水印
|
||||
ImgMix string //合成水印后的图片
|
||||
ImgOrigin string //skuname里的img
|
||||
Img string
|
||||
Img2 string
|
||||
Img3 string
|
||||
Img4 string
|
||||
Img5 string
|
||||
DescImg string
|
||||
ImgWatermark string `json:"imgWatermark"` //图片水印
|
||||
ImgMix string //合成水印后的图片
|
||||
ImgOrigin string //skuname里的img
|
||||
QuaPictures string // 资质图片
|
||||
QuaEffectiveDate int64 // 资质有效期
|
||||
QuaApprovalDate int64 // 批准日期
|
||||
|
||||
VendorVendorCatID int64 `orm:"column(vendor_vendor_cat_id)"` // 平台商品分类(叶子结点)
|
||||
CategoryName string `json:"categoryName"` //分类名
|
||||
@@ -139,23 +142,19 @@ type StoreSkuSyncInfo struct {
|
||||
CatSyncStatus int8
|
||||
VendorCatID string `orm:"column(vendor_cat_id)"`
|
||||
SkuVendorMapCatID string `orm:"column(sku_vendor_map_cat_id)"`
|
||||
|
||||
VendorPrice int64 // 平台价格
|
||||
LockTime *time.Time
|
||||
|
||||
MergedStatus int
|
||||
SkuName string
|
||||
SkuNameOrigin string
|
||||
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
|
||||
StatusSaleEnd int16 `json:"statusSaleEnd"`
|
||||
|
||||
VendorActID string `orm:"column(vendor_act_id);size(48)" json:"vendorActID"`
|
||||
ActPercentage int `json:"actPercentage"` // 直降活动百分比
|
||||
ActSyncStatus int8 `orm:"default(2)" json:"actSyncStatus"`
|
||||
VendorActPrice int64 `json:"vendorActPrice"` // 保存数据用,实际的活动价
|
||||
MtLadderBoxPrice int `json:"mtLadderBoxPrice"` //美团门店商品的包装费
|
||||
|
||||
IsDeletedBySku bool `json:"isDeletedBySku"` //京东商城用,同步下架的商品库里的sku时,要做区分来决定调的api
|
||||
VendorPrice int64 // 平台价格
|
||||
LockTime *time.Time
|
||||
MergedStatus int
|
||||
SkuName string
|
||||
SkuNameOrigin string
|
||||
StatusSaleBegin int16 `json:"statusSaleBegin"` //商品可售时间范围
|
||||
StatusSaleEnd int16 `json:"statusSaleEnd"`
|
||||
VendorActID string `orm:"column(vendor_act_id);size(48)" json:"vendorActID"`
|
||||
ActPercentage int `json:"actPercentage"` // 直降活动百分比
|
||||
ActSyncStatus int8 `orm:"default(2)" json:"actSyncStatus"`
|
||||
VendorActPrice int64 `json:"vendorActPrice"` // 保存数据用,实际的活动价
|
||||
MtLadderBoxPrice int `json:"mtLadderBoxPrice"` //美团门店商品的包装费
|
||||
IsDeletedBySku bool `json:"isDeletedBySku"` //京东商城用,同步下架的商品库里的sku时,要做区分来决定调的api
|
||||
}
|
||||
|
||||
type MissingStoreSkuInfo struct {
|
||||
@@ -591,7 +590,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.vendor_son_sku_id,t1.vendor_sku_attr_id,t1.vendor_main_id,
|
||||
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,t1.location_code,
|
||||
t2.*,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,
|
||||
t3.sell_point,t3.sell_point_times,t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
@@ -721,7 +720,8 @@ 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, t1.stock,t1.location_code,
|
||||
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.category_id name_category_id,t3.tiktok_attribute,t3.mt_attribute,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_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.category_id name_category_id,t3.tiktok_attribute,
|
||||
t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
IF(t13.%s <> '', t13.%s, t3.desc_img) desc_img,
|
||||
|
||||
@@ -191,8 +191,11 @@ type SkuName struct {
|
||||
VideoID string `orm:"column(video_id)" json:"videoID"` //商品视频美团ID
|
||||
TiktokAttribute string `orm:"column(tiktok_attribute);size(1024)" json:"tiktokAttribute"` //抖音分类属性的存储
|
||||
MtAttribute string `orm:"column(mt_attribute);size(1024)" json:"mtAttribute"` //美团分类属性的存储
|
||||
SellPoint string `orm:"column(sell_point);size(128)" json:"sellPoint"` //商品卖点 :(1)限制长度最多不能超过15个字符。 (2)不允许上传emoji等表情符。 (3)更新时传递EMPTY_VALUE支持置空。
|
||||
SellPoint string `orm:"column(sell_point);size(128)" json:"sellPoint"` // 商品卖点 :(1)限制长度最多不能超过15个字符。 (2)不允许上传emoji等表情符。 (3)更新时传递EMPTY_VALUE支持置空。
|
||||
SellPointTimes string `orm:"column(sell_point_times);size(256)" json:"sellPointTimes"` // 商品卖点展示期,更新时传递EMPTY_VALUE支持置空。{"start_time":1,"end_time":2} 秒级时间戳
|
||||
QuaPictures string `orm:"column(qua_pictures);size(512)" json:"quaPictures"` // 商品资质图片,非必填,医疗器械必须传,保健食品、特殊医学配方食品建议传
|
||||
QuaEffectiveDate int64 `orm:"column(qua_effective_date)" json:"quaEffectiveDate"` // 商品资质有效期,传10位秒级的时间戳。-1:永久有效。
|
||||
QuaApprovalDate int64 `orm:"column(qua_approval_date)" json:"quaApprovalDate"` // 批准日期,格式为10位秒级的时间戳。
|
||||
}
|
||||
|
||||
func (*SkuName) TableUnique() [][]string {
|
||||
|
||||
@@ -400,6 +400,12 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
if storeSku.DescImg != "" {
|
||||
foodData["picture_contents"] = storeSku.DescImg
|
||||
}
|
||||
if storeSku.QuaPictures != "" {
|
||||
foodData["qua_pictures"] = storeSku.QuaPictures
|
||||
foodData["qua_effective_date"] = storeSku.QuaEffectiveDate
|
||||
foodData["qua_approval_date"] = storeSku.QuaApprovalDate
|
||||
}
|
||||
|
||||
// 周期性可售时间段
|
||||
if storeSku.StatusSaleBegin != model.NO && storeSku.StatusSaleEnd != model.NO {
|
||||
saleStart := utils.Int2Str(int(storeSku.StatusSaleBegin))
|
||||
|
||||
Reference in New Issue
Block a user