This commit is contained in:
laodaming
2023-08-29 14:35:04 +08:00
parent e7496fcebb
commit f8a89a7bc6
3 changed files with 32 additions and 22 deletions

View File

@@ -5,7 +5,7 @@ import (
)
func (s *FsProductSizeModel) FindOne(ctx context.Context, id int64) (resp *FsProductSize, err error) {
err = s.db.WithContext(ctx).Model(&FsProductSize{}).Where("`id` = ? ", id).First(&resp).Error
err = s.db.WithContext(ctx).Model(&FsProductSize{}).Where("`id` = ? ", id).Take(&resp).Error
return resp, err
}
func (s *FsProductSizeModel) GetAllByIds(ctx context.Context, ids []int64, sort string) (resp []FsProductSize, err error) {
@@ -108,3 +108,7 @@ func (s *FsProductSizeModel) GetProductFirstSize(ctx context.Context, productId
Take(&resp).Error
return resp, err
}
func (s *FsProductSizeModel) FindOneByIdProductId(ctx context.Context, id int64, productId int64) (resp *FsProductSize, err error) {
err = s.db.WithContext(ctx).Model(&FsProductSize{}).Where("`id` = ? and product_id = ?", id, productId).Take(&resp).Error
return resp, err
}