外贸加价算法
程序员文章站
2022-07-12 20:30:24
...
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
上一篇: 怎么样吃到孩子手中的糖
下一篇: ruby一些类加载方式