`

外贸加价算法

阅读更多
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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics