feat 历史价格返回数组
This commit is contained in:
parent
6f81fc7614
commit
59f6b018ef
@ -14,7 +14,7 @@ type ProviderArticleApi interface {
|
|||||||
BatchUpdate(articles []v2.ProviderArticle) error
|
BatchUpdate(articles []v2.ProviderArticle) error
|
||||||
AutoMigrate() error
|
AutoMigrate() error
|
||||||
FindInBatches(query *GetProviderArticleQuery, results *[]v2.ProviderArticle, f func(tx *gorm.DB, batch int) error) error
|
FindInBatches(query *GetProviderArticleQuery, results *[]v2.ProviderArticle, f func(tx *gorm.DB, batch int) error) error
|
||||||
ProviderPrice(query *GetProviderArticleQuery) (history v2.ProviderPrice, err error)
|
ProviderPrice(query *GetProviderArticleQuery) (history []v2.ProviderPrice, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type providerArticleApi struct {
|
type providerArticleApi struct {
|
||||||
@ -113,7 +113,7 @@ func (p *providerArticleApi) AutoMigrate() error {
|
|||||||
return p.db.AutoMigrate(&v2.ProviderArticle{}, &v2.ProviderPrice{})
|
return p.db.AutoMigrate(&v2.ProviderArticle{}, &v2.ProviderPrice{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *providerArticleApi) ProviderPrice(query *GetProviderArticleQuery) (history v2.ProviderPrice, err error) {
|
func (p *providerArticleApi) ProviderPrice(query *GetProviderArticleQuery) (history []v2.ProviderPrice, err error) {
|
||||||
err = p.db.Scopes(query.Scope).Find(&history).Error
|
err = p.db.Scopes(query.Scope).Find(&history).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ type SellerArticleApi interface {
|
|||||||
Update(sellerArticle v2.SellerArticle, selects ...string) error
|
Update(sellerArticle v2.SellerArticle, selects ...string) error
|
||||||
FindInBatches(query *GetSellerArticleQuery, results *[]v2.SellerArticle, f func(tx *gorm.DB, batch int) error) error
|
FindInBatches(query *GetSellerArticleQuery, results *[]v2.SellerArticle, f func(tx *gorm.DB, batch int) error) error
|
||||||
AutoMigrate() error
|
AutoMigrate() error
|
||||||
SellerPrice(query *GetSellerArticleQuery) (history v2.SellerPrice, err error)
|
SellerPrice(query *GetSellerArticleQuery) (history []v2.SellerPrice, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type sellerArticleApi struct {
|
type sellerArticleApi struct {
|
||||||
@ -109,7 +109,7 @@ func (p *sellerArticleApi) AutoMigrate() error {
|
|||||||
return p.db.AutoMigrate(&v2.SellerArticle{}, &v2.SellerPrice{})
|
return p.db.AutoMigrate(&v2.SellerArticle{}, &v2.SellerPrice{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *sellerArticleApi) SellerPrice(query *GetSellerArticleQuery) (history v2.SellerPrice, err error) {
|
func (p *sellerArticleApi) SellerPrice(query *GetSellerArticleQuery) (history []v2.SellerPrice, err error) {
|
||||||
err = p.db.Scopes(query.Scope).Find(&history).Error
|
err = p.db.Scopes(query.Scope).Find(&history).Error
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user