fix 修复updateRate会更新其他网站的bug
All checks were successful
Build image / build (push) Successful in 1m7s
All checks were successful
Build image / build (push) Successful in 1m7s
This commit is contained in:
parent
c93194ec3e
commit
1ba8b29a77
@ -41,7 +41,7 @@ func (c *Controller) SaveOption(opt Option) {
|
|||||||
|
|
||||||
func (c *Controller) updateRate(oldFreight float64) {
|
func (c *Controller) updateRate(oldFreight float64) {
|
||||||
var results []*productv1.Product
|
var results []*productv1.Product
|
||||||
c.db.FindInBatches(&results, 20, func(tx *gorm.DB, batch int) error {
|
c.db.Where("website = ?", productv1.WebSite_US_Coach_Outlet).FindInBatches(&results, 20, func(tx *gorm.DB, batch int) error {
|
||||||
for _, result := range results {
|
for _, result := range results {
|
||||||
if result.Freight == oldFreight {
|
if result.Freight == oldFreight {
|
||||||
result.Freight = c.Option.Freight
|
result.Freight = c.Option.Freight
|
||||||
|
Loading…
Reference in New Issue
Block a user