添加美团个各个平台相互复制

This commit is contained in:
邹宗楠
2025-03-17 13:46:20 +08:00
parent ea73635848
commit 8306b04823
7 changed files with 832 additions and 38 deletions

View File

@@ -14,3 +14,19 @@ func GetVendorImg(skuId, vendorId int) (*model.TaoSkuImg, error) {
return result, nil
}
func GetCopyInfo(fromVendorStoreId string, fromVendorId int, toVendorStoreID string, toVendorId int) (map[string]*model.CopyVendorSku, error) {
result := make([]*model.CopyVendorSku, 0, 0)
sql := ` SELECT * FROM copy_vendor_sku WHERE from_store_id = ? AND from_vendor_id = ? AND to_store_id = ? AND to_vendor_id = ?`
if err := GetRows(GetDB(), &result, sql, []interface{}{fromVendorStoreId, fromVendorId, toVendorStoreID, toVendorId}); err != nil {
return nil, err
}
data := make(map[string]*model.CopyVendorSku, len(result))
for _, v := range result {
data[v.FromSkuID] = v
}
return data, nil
}