ecshop推荐注册赠送消费积分

ecshop里面有个推荐分成的功能,推荐用户可以得积分,但这个自动送积分是送的等级积分,一般站长需要注册送推荐人的是消费积分,这个该怎么修改呢,银众网络技术人员整理出一下代码,供需要ecshop二次开发的朋友参考:废话不多说,直接上代码:

1、打开文件:includes/lib_passport.php

2、大约在125行找到下面代码:

// 推荐开关开启

$up_uid = get_affiliate();

empty($affiliate) && $affiliate = array();

$affiliate['config']['level_register_all'] = intval($affiliate['config']['level_register_all']);

$affiliate['config']['level_register_up'] = intval($affiliate['config']['level_register_up']);

if ($up_uid)

{

if (!empty($affiliate['config']['level_register_all']))

{

if (!empty($affiliate['config']['level_register_up']))

{

$rank_points = $GLOBALS['db']->getOne(”SELECT rank_points FROM ” . $GLOBALS['ecs']->table(’users’) . ” WHERE user_id = ‘$up_uid’”);

if ($rank_points + $affiliate['config']['level_register_all'] <= $affiliate['config']['level_register_up'])

{

log_account_change($up_uid, 0, 0, $affiliate['config']['level_register_all'], 0, sprintf($GLOBALS['_LANG']['register_affiliate'], $_SESSION['user_id'], $username));

}

}

else

{

log_account_change($up_uid, 0, 0, $affiliate['config']['level_register_all'], 0, $GLOBALS['_LANG']['register_affiliate']);

}

}

代码中:0,0,$affiliate['config']['level_register_all'],0 这上面的数字分别表示:可用资金、冻结资金、等级积分、消费积分,因此修改为:0,0,0,$affiliate['config']['level_register_all'],即可实现。如果你需要注册同时送推荐人等级积分和消费积分,就可以直接改成这样 0,0,$affiliate['config']['level_register_all'],$affiliate['config']['level_register_all'],

当然你也可以新增一个字段,用来专门设置注册送消费积分。 本站内容如转载,需注明来源:银众网络,本文链接:http://www.yinzhong.net/article/40.html