feat 判断有货才提醒
Some checks failed
Build image / build (push) Failing after 0s

This commit is contained in:
timerzz 2024-07-29 22:02:28 +08:00
parent a26ed82119
commit e52227de9b

View File

@ -97,7 +97,7 @@ func (c *Controller) Crawl() error {
if err = c.db.Select("rate", "dw_price").Updates(&product).Error; err != nil { if err = c.db.Select("rate", "dw_price").Updates(&product).Error; err != nil {
slog.Warn(fmt.Sprintf("更新pid:%s的数据库失败%v", product.Pid, err)) slog.Warn(fmt.Sprintf("更新pid:%s的数据库失败%v", product.Pid, err))
} }
if product.Rate >= 15 { if product.Rate >= 15 && product.Orderable {
c.Push(fmt.Sprintf("%s 的收益率达到%.2f%%", product.Pid, product.Rate), c.Push(fmt.Sprintf("%s 的收益率达到%.2f%%", product.Pid, product.Rate),
fmt.Sprintf("%s 的成本为%.2f, 得物收益为%.2f, 收益率为%.2f%% 链接:%s", product.Pid, product.CNYPrice, product.DWPrice, product.Rate, product.Link)) fmt.Sprintf("%s 的成本为%.2f, 得物收益为%.2f, 收益率为%.2f%% 链接:%s", product.Pid, product.CNYPrice, product.DWPrice, product.Rate, product.Link))
} }