Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson
2023-08-29 14:36:58 +08:00
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
}