This commit is contained in:
邹宗楠
2024-12-04 14:11:47 +08:00
parent 2c7dd39195
commit a4d92205fd
7 changed files with 67 additions and 54 deletions

View File

@@ -83,6 +83,7 @@ type StoreSkuSyncInfo struct {
VendorMainId string `orm:"column(vendor_main_id)"` // 主商品id
JdsWareID int64 `orm:"column(jds_ware_id)" json:"jdsWareID"`
BindDeletedAt time.Time `orm:"type(datetime)" json:"bindDeletedAt"`
LocationCode string `orm:"column(location_code)" json:"locationCode"` // 商品货架码
model.Sku
ExdSkuID string `orm:"column(exd_sku_id)"`
@@ -273,6 +274,7 @@ type StoreSkuExt struct {
Weight int `json:"weight"` // 重量/质量单位为克当相应的SkuName的SpecUnit为g或kg时必须等于SpecQuality
SkuStatus int `json:"status"`
Stock int `json:"stock"`
LocationCode string `orm:"column(location_code)" json:"locationCode"`
CategoryName string `orm:"column(categoryName)"`
BindCreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
BindUpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"updatedAt"`
@@ -582,7 +584,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
t14.vendor_id, t14.vendor_org_code,
t1.id bind_id, t1.sku_id, t1.price, t1.unit_price, t1.status store_sku_status,
%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.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.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,
@@ -712,7 +714,7 @@ func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInf
sm.vendor_id, sm.vendor_org_code, sm.yb_app_id, sm.yb_app_key,
t1.id bind_id, t1.price, t1.unit_price, t1.status store_sku_status,
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.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,
IF(t11.%s <> '', t11.%s, t3.img) img,

View File

@@ -110,51 +110,44 @@ type StoreSkuBind struct {
Stock int `json:"stock"` //门店商品库存
Status int
// ElmID int64 `orm:"column(elm_id);index"`
MtwmID int64 `orm:"column(mtwm_id);index"`
TaoID int64 `orm:"column(tao_id);index"`
EbaiID int64 `orm:"column(ebai_id);index"`
YbID int64 `orm:"column(yb_id);index"`
JdsID int64 `orm:"column(jds_id);index"`
JdsWareID int64 `orm:"column(jds_ware_id)"`
DdID int64 `orm:"column(dd_id);index"` // 子品主商品id
VendorSonSkuID string `orm:"column(vendor_son_sku_id)"` // 子商品skuid
VendorSkuAttrId string `orm:"column(vendor_sku_attr_id)"` // 抖音需要,主品skuid
VendorMainId string `orm:"column(vendor_Main_id)"` // 抖音需要,商品主id
JdSyncStatus int8 `orm:"default(2)"`
MtwmSyncStatus int8 `orm:"default(2)"`
TaoSyncStatus int8 `orm:"default(2)"`
DdSyncStatus int8 `orm:"default(2)"`
EbaiSyncStatus int8 `orm:"default(2)"`
YbSyncStatus int8 `orm:"default(2)"`
JdsSyncStatus int8 `orm:"default(2)"` //京东商城
JdPrice int `json:"jdPrice"`
MtwmPrice int `json:"mtwmPrice"`
TaoPrice int `json:"taoPrice"`
EbaiPrice int `json:"ebaiPrice"`
JxPrice int `json:"jxPrice"`
DdPrice int `json:"ddPrice"`
YbPrice int `json:"ybPrice"`
JdsPrice int `json:"jdsPrice"`
//GmPrice int `json:"gmPrice"`
JdLockTime *time.Time `orm:"null" json:"jdLockTime"`
JdsLockTime *time.Time `orm:"null" json:"jdsLockTime"`
MtwmLockTime *time.Time `orm:"null" json:"mtwmLockTime"`
TaoLockTime *time.Time `orm:"null" json:"taoLockTime"`
EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"`
JxLockTime *time.Time `orm:"null" json:"jxLockTime"`
YbLockTime *time.Time `orm:"null" json:"ybLockTime"`
DdLockTime *time.Time `orm:"null" json:"ddLockTime"`
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`
StatusSaleBegin int16 //商品可售时间范围
StatusSaleEnd int16
MtLadderBoxPrice int `json:"mtLadderBoxPrice"` //美团门店商品包装费
MtwmID int64 `orm:"column(mtwm_id);index"`
TaoID int64 `orm:"column(tao_id);index"`
EbaiID int64 `orm:"column(ebai_id);index"`
YbID int64 `orm:"column(yb_id);index"`
JdsID int64 `orm:"column(jds_id);index"`
JdsWareID int64 `orm:"column(jds_ware_id)"`
DdID int64 `orm:"column(dd_id);index"` // 子品主商品id
VendorSonSkuID string `orm:"column(vendor_son_sku_id)"` // 子商品skuid
VendorSkuAttrId string `orm:"column(vendor_sku_attr_id)"` // 抖音需要,主品skuid
VendorMainId string `orm:"column(vendor_Main_id)"` // 抖音需要,商品主id
JdSyncStatus int8 `orm:"default(2)"`
MtwmSyncStatus int8 `orm:"default(2)"`
TaoSyncStatus int8 `orm:"default(2)"`
DdSyncStatus int8 `orm:"default(2)"`
EbaiSyncStatus int8 `orm:"default(2)"`
YbSyncStatus int8 `orm:"default(2)"`
JdsSyncStatus int8 `orm:"default(2)"` //京东商城
JdPrice int `json:"jdPrice"`
MtwmPrice int `json:"mtwmPrice"`
TaoPrice int `json:"taoPrice"`
EbaiPrice int `json:"ebaiPrice"`
JxPrice int `json:"jxPrice"`
DdPrice int `json:"ddPrice"`
YbPrice int `json:"ybPrice"`
JdsPrice int `json:"jdsPrice"`
JdLockTime *time.Time `orm:"null" json:"jdLockTime"`
JdsLockTime *time.Time `orm:"null" json:"jdsLockTime"`
MtwmLockTime *time.Time `orm:"null" json:"mtwmLockTime"`
TaoLockTime *time.Time `orm:"null" json:"taoLockTime"`
EbaiLockTime *time.Time `orm:"null" json:"ebaiLockTime"`
JxLockTime *time.Time `orm:"null" json:"jxLockTime"`
YbLockTime *time.Time `orm:"null" json:"ybLockTime"`
DdLockTime *time.Time `orm:"null" json:"ddLockTime"`
AutoSaleAt time.Time `orm:"type(datetime);null" json:"autoSaleAt"`
StatusSaleBegin int16 //商品可售时间范围
StatusSaleEnd int16
MtLadderBoxPrice int `json:"mtLadderBoxPrice"` //美团门店商品包装费
LocationCode string `orm:"column(location_code)" json:"locationCode"`
}
func (*StoreSkuBind) TableUnique() [][]string {