shopnc 二次开发 每天签到积分领取
程序员文章站
2022-06-08 18:25:26
...
shopnc 二次开发 每日签到积分领取
/*
开始shopnc!!!!!
url:xxx.com/index.php?act=index&op=userjf
一个四线城市的半吊子程序员~
实现:前台模板文件 随便加入标签来实现。
*/
Mode :points.model.php
方法: savePointsLog 添加:
case 'day': if(!$insertarr['pl_desc']){ $insertarr['pl_desc'] = Language::get('pointsdaydesc'); } break;
Language :common.php
添加"pointsdaydesc"
$lang['alert_no'] = '对不起,您一天只能领取一次!';
$lang['alert_ok'] = '每天登录一点点';
$lang['user_check'] = '请登录';
control :index.php
添加 "userjfOp"
public function userjfOp(){Language::read("common");$lang = Language::getLangContent();$model = Model('member');$user =array(); if($_SESSION['is_login'] != '1') { showDialog($lang['user_check'],'./index.php?act=login&op=index');}$user['member_points'] = $model->getMemberInfo(array('member_id'=>$_SESSION['member_id']),'member_points');if($user['member_points'] == '0' ) { $model->checkloginMember();}$userpoints = rand(0,10);if($userpoints =='0' ){ $userpoints = rand(0,10);}//$userpoints ='0.'.$userpoints;$model_points =Model('points');$arr_points = array();$pix = $model_points->getPointsInfo(array('pl_memberid'=>$_SESSION['member_id'],'order'=>'points_log.pl_points desc'));$pix_r = date("Y-m-d H:i:s", $pix['pl_addtime']+86400) ; //计算24小时之内的时间$today = date("Y-m-d H:i:s",time());if($pix_r $today) {$model_points->savePointsLog('day',array('pl_memberid'=>$_SESSION['member_id'],'pl_membername'=>$_SESSION['member_name'],'pl_points'=>$userpoints)); showDialog($lang['alert_ok']);}else { showDialog($lang['alert_no']);}
相关文章
相关视频
专题推荐
-
独孤九贱-php全栈开发教程
全栈 170W+
主讲:Peter-Zhu 轻松幽默、简短易学,非常适合PHP学习入门
-
玉女心经-web前端开发教程
入门 80W+
主讲:灭绝师太 由浅入深、明快简洁,非常适合前端学习入门
-
天龙八部-实战开发教程
实战 120W+
主讲:西门大官人 思路清晰、严谨规范,适合有一定web编程基础学习
- 最新文章
- 热门排行
上一篇: web端实现后退强制刷新功能代码
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论