feat providerArticle添加find方法

This commit is contained in:
timerzz 2024-11-29 17:10:53 +08:00
parent 7104275251
commit 14d09efa36

View File

@ -13,7 +13,7 @@ type ProviderArticleApi interface {
Update(providerArticle v2.ProviderArticle, selects ...string) error
BatchUpdate(articles []v2.ProviderArticle) error
AutoMigrate() error
Find(query *GetProviderArticleQuery) (articles []v2.ProviderArticle, err error)
Find(query *GetProviderArticleQuery) (articles []*v2.ProviderArticle, err error)
List(query PageListQuery, scopes ...func(db *gorm.DB) *gorm.DB) (articles []v2.ProviderArticle, total int64, err error)
FindInBatches(query *GetProviderArticleQuery, results *[]v2.ProviderArticle, f func(tx *gorm.DB, batch int) error) error
ProviderPrice(providerArticleID uint) (history []v2.ProviderPrice, err error)
@ -137,7 +137,7 @@ func (p *providerArticleApi) List(query PageListQuery, scopes ...func(db *gorm.D
return
}
func (p *providerArticleApi) Find(query *GetProviderArticleQuery) (articles []v2.ProviderArticle, err error) {
func (p *providerArticleApi) Find(query *GetProviderArticleQuery) (articles []*v2.ProviderArticle, err error) {
err = p.db.Scopes(query.Scope).Find(&articles).Error
return
}