$sql = 'SELECT last_login FROM ' . $GLOBALS['ecs']->table('users') . " WHERE user_id = '" . $_SESSION['user_id'] . "'";
$last_login = $GLOBALS['db']->getOne($sql);
if($last_login < (strtotime(date("y-m-d"))-8*3600))
{
log_account_change($_SESSION['user_id'], 0, 0, $GLOBALS['_CFG']['login_points'], $GLOBALS['_CFG']['login_points'],"会员每天 次登录赠送".$GLOBALS['_CFG']['login_points']."积分");
}
数据库插入SQL语句:
INSERT INTO `ecs_shop_config` (`parent_id`, `code`, `type`, `store_range`, `store_dir`, `value`, `sort_order` ) VALUES ( '2', 'login_points', 'text', '', '', '100', '1');
languageszh_cnadminshop_config.php,
查找$_LANG['cfg_name']['integral_percent'] = '积分支付比例';下面添加:
if($_SESSION['user_id'])
{
$now_time = gmtime();
$sql = "select last_login from ".$ecs->table('users')." where user_id = ".$_SESSION['user_id'];
$last_login = $db->getOne($sql);
if(($last_login + $_CFG['tingliu_time']) < $now_time)
{
$today = strtotime(date("y-m-d"))-8*3600;//当天时间
$sql = "select count(log_id) as log_num from ".$ecs->table('account_log')." where user_id = ".$_SESSION['user_id'].
" and change_type = 98 and change_time > ".$today;
$log_num = $db->getOne($sql);
if($log_num == 0)
{
log_account_change($_SESSION['user_id'], 0, 0, $_CFG['tingliu_points'], $_CFG['tingliu_points'],"停留时间超过".$_CFG['tingliu_time']."秒赠送".$_CFG['tingliu_points']."积分",98);
}
}
}
数据库插入SQL语句
INSERT INTO `ecs_shop_config` (`parent_id`, `code`, `type`, `store_range`, `store_dir`, `value`, `sort_order` ) VALUES ( '2', 'tingliu_points', 'text', '', '', '100', '1');
INSERT INTO `ecs_shop_config` (`parent_id`, `code`, `type`, `store_range`, `store_dir`, `value`, `sort_order` ) VALUES ( '2', 'tingliu_time', 'text', '', '', '100', '1');
languageszh_cnadminshop_config.php,
查找$_LANG['cfg_name']['integral_percent'] = '积分支付比例';下面添加:
$_LANG['cfg_name']['tingliu_points'] = '长时间登录赠送积分';
$_LANG['cfg_name']['tingliu_time'] = '停留时间(单位:秒)';
$_LANG['cfg_desc']['tingliu_points'] = '一天只赠送一次。';
在商店设置-基本设置-最下面设置 设置相关的参数 版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: ecshop会员登录赠送等级积分和消费积分插件