ECSHOP邮件验证后送积分

2016-06-13 13:05 来源:www.chinab4c.com 作者:ecshop专家

lib_common.php 的 log_account_change方法 /** * 记录帐户变动 * @param int     $user_id       用户id * @param float $user_money     可用余额变动 * @param float $frozen_money 冻结余额变动 * @param int     $rank_points 等级积分变动 * @param int     $pay_points     消费积分变动 * @param string   $change_desc 变动说明 * @param int     $change_type 变动类型:参见常量文件 * @return   void */ function log_account_change($user_id, $user_money = 0, $frozen_money = 0, $rank_points = 0, $pay_points = 0, $change_desc = '', $change_type = ACT_OTHER) 它会执行两个动作,一个是调整注册会员积分调整记录日志,一个就是修改个人帐户的积分了。   在user.php验证邮件方法下加入如下代码 /* 验证用户注册邮件 */ elseif ($action == 'validate_email') { $hash = empty($_GET['hash']) ? '' : trim($_GET['hash']); if ($hash) {        include_once(ROOT_PATH . 'includes/lib_passport.php');        $id = register_hash('decode', $hash);        if ($id > 0)        {          $sql = 'SELECT is_validated FROM '.$ecs->table('users')." WHERE user_id='$id'";                      $row = $db->getRow($sql);                      if($row['is_validated'] == 0)                      {                                $sql = "UPDATE " . $ecs->table('users') . " SET is_validated = 1 WHERE user_id='$id'";                                $db->query($sql);                                $sql = 'SELECT user_name, email FROM ' . $ecs->table('users') . " WHERE user_id = '$id'";                                $row = $db->getRow($sql);                                //验证完成 送积分 by gaojin 201003300850                                include_once(ROOT_PATH .'includes/lib_common.php');                                log_account_change($id, 0, 0, 0, 500,$GLOBALS['_LANG']['register_points']);                                show_message(sprintf($_LANG['validate_ok'], $row['user_name'], $row['email']),$_LANG['profile_lnk'], 'user.php');                                                    }                      else                      {                                show_message(sprintf('请不要重复验证', $row['user_name'], $row['email']),$_LANG['profile_lnk'], 'user.php');                      }        } } show_message($_LANG['validate_fail']); } 希望对大家有所帮助 修改了重复点击验证邮件未验证的bug,会导致重复送积分的问题