You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
942 B

package goods
import (
"recook/internal/v2/lib/db"
)
type RecookGoodsPromotionPhotoModel struct {
db.BaseModel
Id uint `gorm:"column:id;primary_key" json:"id"`
GoodsId uint `gorm:"column:goods_id" json:"goodsId"`
Url string `gorm:"column:url" json:"url"`
Width int `gorm:"column:width" json:"width"`
Height int `gorm:"column:height" json:"height"`
Name int `gorm:"column:name" json:"name"`
}
// TableName sets the insert table name for this struct type
func (r *RecookGoodsPromotionPhotoModel) TableName() string {
return "recook_goods_promotion_photo"
}
func (r *RecookGoodsPromotionPhotoModel) Create(data *RecookGoodsPromotionPhotoModel) {
r.GetDb().Create(data)
}
// @Style 获取
func (r *RecookGoodsPromotionPhotoModel) FindByGoodsId(goodsId uint) (result []RecookGoodsPromotionPhotoModel) {
r.GetDb().Model(&RecookGoodsPromotionPhotoModel{}).Find(&result, "goods_id = ?", goodsId)
return
}