Discuz! X3 积分不足自动使用交易积分的方法(2018/11/11修正)
分类 网站技术/村民张先生 发布于 2017-04-19 20:11
2、打开 source/function/function_credit.php 文件,查找:
$credit->updatemembercount($data, $uids, $checkgroup, $ruletxt); }
在其下方增加(当进行 updatemembercount 操作时,如果可消耗但不是非交易积分的积分欠费时,自动从交易积分兑换归0,下面的数字同样按照上一步所述修改):
if(!is_array($uids) && count($dataarr) == '1' && ($dataarr['extcredits6'] || $dataarr['extcredits7'] || $dataarr['extcredits8']) && $operation != 'CEC') { $cmc = DB::fetch_first('select * from '.DB::table('common_member_count').' where uid='.$uids); if($cmc['extcredits6'] < 0 || $cmc['extcredits7'] < 0) { $extcredits6_qianfei = $cmc['extcredits6'] < 0 ? (0 - $cmc['extcredits6']) : 0; $extcredits7_qianfei = $cmc['extcredits7'] < 0 ? (0 - $cmc['extcredits7']) : 0; $koufei = ($extcredits6_qianfei + $extcredits7_qianfei) / 10; _updatemembercount($uids, array('extcredits6' => $extcredits6_qianfei, 'extcredits7' => $extcredits7_qianfei, 'extcredits8' => -$koufei), false, 'CEC', $uids); } }
欢迎谈谈你的看法(无须登录) *正文中请勿包含"http://"否则将被拦截