feat 测试
This commit is contained in:
parent
15e36c1180
commit
2fc5434f95
@ -51,9 +51,9 @@ func (a *articleApi) Upsert(article v2.Article) error {
|
|||||||
|
|
||||||
func (a *articleApi) Update(article v2.Article, selects ...string) error {
|
func (a *articleApi) Update(article v2.Article, selects ...string) error {
|
||||||
if len(selects) > 0 {
|
if len(selects) > 0 {
|
||||||
selects = []string{"Remark", "Exclude"}
|
selects = []string{"remark", "exclude"}
|
||||||
}
|
}
|
||||||
return a.db.Model(&article).Debug().Select(selects).Omit(clause.Associations).Updates(article).Error
|
return a.db.Debug().Select(selects).Omit(clause.Associations).Updates(article).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// ******************Find和List
|
// ******************Find和List
|
||||||
|
@ -102,7 +102,7 @@ func (p *providerApi) UpdateStatus(provider v2.Provider) error {
|
|||||||
if provider.ID == 0 {
|
if provider.ID == 0 {
|
||||||
return fmt.Errorf("id为空")
|
return fmt.Errorf("id为空")
|
||||||
}
|
}
|
||||||
return p.db.Model(&provider).Where("id=?", provider.ID).Select("status", "msg", "pull_at").Updates(&provider).Error
|
return p.db.Where("id=?", provider.ID).Select("status", "msg", "pull_at").Updates(&provider).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *providerApi) Delete(id uint) (provider v2.Provider, err error) {
|
func (p *providerApi) Delete(id uint) (provider v2.Provider, err error) {
|
||||||
|
@ -102,7 +102,7 @@ func (p *sellerApi) UpdateStatus(seller v2.Seller) error {
|
|||||||
if seller.ID == 0 {
|
if seller.ID == 0 {
|
||||||
return fmt.Errorf("id为空")
|
return fmt.Errorf("id为空")
|
||||||
}
|
}
|
||||||
return p.db.Model(&seller).Where("id=?", seller.ID).Select("status", "msg", "pull_at").Updates(&seller).Error
|
return p.db.Where("id=?", seller.ID).Select("status", "msg", "pull_at").Updates(&seller).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *sellerApi) Delete(id uint) (seller v2.Seller, err error) {
|
func (p *sellerApi) Delete(id uint) (seller v2.Seller, err error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user