This commit is contained in:
parent
dffffd52d7
commit
8260be804b
@ -132,6 +132,9 @@ func (c *Controller) saveRespData(list []coach_client.Product) error {
|
||||
var historyPrice []productv1.HistoryPrice
|
||||
c.db.Model(&productv1.HistoryPrice{}).Find(&historyPrice, "pid = ?", p.Pid)
|
||||
if len(historyPrice) > 0 {
|
||||
historyPrice = lo.Filter(historyPrice, func(item productv1.HistoryPrice, index int) bool {
|
||||
return item.OriginalPrice > 0
|
||||
})
|
||||
lowestPrice := lo.MinBy(historyPrice, func(a productv1.HistoryPrice, b productv1.HistoryPrice) bool {
|
||||
return a.OriginalPrice < b.OriginalPrice
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user