From e7fa9e7dd21a70397efa77e876c9d408731d017d Mon Sep 17 00:00:00 2001 From: timerzz Date: Fri, 14 Jun 2024 17:57:01 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/product/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/product/model.go b/model/product/model.go index cf3d548..308679f 100644 --- a/model/product/model.go +++ b/model/product/model.go @@ -94,7 +94,7 @@ func (p *Product) fillUSCoachPriceStatus(tx *gorm.DB) { func (p *Product) fillCNCoachPriceStatus(tx *gorm.DB) { var lastPrice float64 - tx.Model(&HistoryPrice{}).Where("pid = ?", p.Pid).Order("created_at desc").Limit(1).Pluck("cny_price", &lastPrice) + tx.Model(&HistoryPrice{}).Where("pid = ?", p.Pid).Order("created_at desc").Limit(1).Pluck("us_price", &lastPrice) if p.CNYPrice != lastPrice { p.HistoryPrices = append(p.HistoryPrices, HistoryPrice{ USPrice: p.CNYPrice,