phpcms v9 实现每天登陆后送2点积分

1、打开phpcms\modules\member\index.php文件;

2、找到这一行代码:

showmessage(L('login_success').$synloginstr, $forward);

3、在这行代码上面添加如下的代码即可:

$todaytimea = strtotime(date('y-m-d',SYS_TIME));
$this->useraccount = pc_base::load_model('pay_account_model');
$rtimea = $this->useraccount->count("`addtime` > $todaytimea AND `username`='$username'");
if ($rtimea<=0){//判断数据库是否有值
pc_base::load_app_class('receipts','pay',0);
receipts::point(2,$userid, $username, $flag,'selfincome','每日登陆',$username);       
}else{
        //echo("今日登录过");
}


你可能感兴趣的:(自动登陆积分)