update 上个最低价供应商能买,这个供应商不能买,那么即使现在的供应商价格更低,也不使用
All checks were successful
Build image / build (push) Successful in 51s

This commit is contained in:
timerzz 2025-03-29 20:35:03 +08:00
parent 5845828066
commit c809922fd5

View File

@ -70,6 +70,10 @@ func (c *Controller) rate(ctx context.Context, idString string) error {
for _, provider := range article.Providers {
final := provider.Cost.FinalPrice
if final > 0 && (final < cost || cost == 0) && !provider.Exclude {
if available && !provider.Available {
// 上个最低价供应商能买,这个供应商不能买,那么即使现在的供应商价格更低,也不使用
continue
}
cost = final
}
available = available || provider.Available