This commit is contained in:
parent
ee35af9328
commit
895b86e38a
@ -259,6 +259,12 @@ func (c *Controller) PullArticle(sArticle v2.SellerArticle) error {
|
|||||||
return item.BiddingType == c.bidType
|
return item.BiddingType == c.bidType
|
||||||
})
|
})
|
||||||
if !exist {
|
if !exist {
|
||||||
|
// 没有拿到对应类型的价格,那就拿一个最低的
|
||||||
|
lowest = lo.MinBy(resp.Items, func(item1, item2 dw_sdk.LowestPriceItem) bool {
|
||||||
|
return item1.LowestPrice < item2.LowestPrice && item1.LowestPrice > 0
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if lowest.LowestPrice == 0 {
|
||||||
// 没有拿到价格,将exclude设置为true,如果后面要拉取,需要手动打开
|
// 没有拿到价格,将exclude设置为true,如果后面要拉取,需要手动打开
|
||||||
sArticle.Exclude = true
|
sArticle.Exclude = true
|
||||||
return c.storage.SellerArticle().Upsert(sArticle)
|
return c.storage.SellerArticle().Upsert(sArticle)
|
||||||
|
Loading…
Reference in New Issue
Block a user