Discuz! X3.* 去掉“兑换”“转账”功能的积分交易税
分类 网站技术/村民张先生 发布于 2015-02-05 21:54
当我们在后台“积分设置”中设置了“积分交易税”后,帖子/附件买卖、转账、兑换等操作都会统一按该税率扣减。我个人觉得几种操作的税率有必要区分开来,大家可以根据自己的需要适当调整以下代码。
1、去掉“兑换”操作的积分交易税。
打开 source/include/spacecp/spacecp_credit_base.php 文件,查找:
if(in_array($_GET['op'], array('transfer', 'exchange'))) { $taxpercent = sprintf('%1.2f', $_G['setting']['creditstax'] * 100).'%'; }
删除其中的 , 'exchange' 。查找:
if($_G['setting']['extcredits'][$tocredits]['ratio'] < $_G['setting']['extcredits'][$fromcredits]['ratio']) { $netamount = ceil($exchangeamount * $_G['setting']['extcredits'][$tocredits]['ratio'] / $_G['setting']['extcredits'][$fromcredits]['ratio'] * (1 + $_G['setting']['creditstax'])); } else { $netamount = floor($exchangeamount * $_G['setting']['extcredits'][$tocredits]['ratio'] / $_G['setting']['extcredits'][$fromcredits]['ratio'] * (1 + $_G['setting']['creditstax'])); }
删除其中的 * (1 + $_G['setting']['creditstax']) ,共两处。
打开当前应用的模板目录下的 home/spacecp_credit_base.htm (如果没有,请从默认模板套系中复制一份),查找:
if(tocredit.getAttribute('ratio') < fromcredit.getAttribute('ratio')) { $('exchangedesamount').value = Math.ceil( tocredit.getAttribute('ratio') / fromcredit.getAttribute('ratio') * $('exchangeamount').value * (1 + $_G[setting][creditstax])); } else { $('exchangedesamount').value = Math.floor( tocredit.getAttribute('ratio') / fromcredit.getAttribute('ratio') * $('exchangeamount').value * (1 + $_G[setting][creditstax])); }
删除其中的下划线部分,即 * (1 + $_G[setting][creditstax]) ,共两处。
欢迎谈谈你的看法(无须登录) *正文中请勿包含"http://"否则将被拦截