欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

外贸加价算法

程序员文章站 2022-07-12 20:30:12
...
usd_price = ( case  
                      when data.vendor_amount <= 500   
                      then  (data.vendor_amount + 200) / 6.7 + 9
                      when data.vendor_amount > 500 && data.vendor_amount <= 1500   
                      then  (data.vendor_amount + 300) / 6.7 + 9
                      when data.vendor_amount > 1500 && data.vendor_amount <= 3000   
                      then  (data.vendor_amount * 1.18) / 6.7 + 9
                      when data.vendor_amount > 3000 && data.vendor_amount <= 5000   
                      then  (data.vendor_amount * 1.15) / 6.7 + 9
                      when data.vendor_amount > 5000 && data.vendor_amount <= 7000   
                      then  (data.vendor_amount * 1.13) / 6.7 + 9
                      when data.vendor_amount > 7000 && data.vendor_amount <= 10000   
                      then  (data.vendor_amount * 1.10) / 6.7 + 9
                      end
                      ).to_i
相关标签: 算法