$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']."積分");
}
數(shù)據(jù)庫插入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;//當(dāng)天時間
$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);
}
}
}
數(shù)據(jù)庫插入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'] = '一天只贈送一次。';
在商店設(shè)置-基本設(shè)置-最下面設(shè)置 設(shè)置相關(guān)的參數(shù) 版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: ecshop會員登錄贈送等級積分和消費(fèi)積分插件