This commit is contained in:
邹宗楠
2023-08-09 16:01:51 +08:00
parent 060d8e5f11
commit 1edb98d9f6

View File

@@ -532,18 +532,11 @@ func uploadImg(api *tao_vegetable.API, skuId, vendorId int, imgs []string) *stri
}
}
if taoImgs.Img == "" && taoImgs.Img2 == "" && taoImgs.Img3 == "" && taoImgs.Img4 == "" && taoImgs.Img5 == "" && taoImgs.DescImg == "" {
return nil
}
taoImgs.SkuID = skuId
taoImgs.VendorID = vendorId
if isCreate {
taoImgs.SkuID = skuId
taoImgs.VendorID = vendorId
dao.CreateEntity(dao.GetDB(), taoImgs)
} else {
dao.UpdateEntity(dao.GetDB(), taoImgs, "Img", "Img2", "Img3", "Img4", "Img5", "DescImg")
}
// 商品图片最多五张
if len(result) > 5 {
return utils.String2Pointer(strings.Join(result[1:], ","))