package db import ( "context" "youngee_b_api/model/gorm_model" ) func GetSketchPhotoBySketchID(ctx context.Context, productID int64) ([]gorm_model.YounggeeSketchPhoto, error) { db := GetReadDB(ctx) SketchPhotos := []gorm_model.YounggeeSketchPhoto{} err := db.Where("product_id = ?", productID).Find(&SketchPhotos).Error if err != nil { return nil, err } return SketchPhotos, nil }