当前位置: 代码迷 >> PHP >> shopnc 二次开发 每天签到积分领取
  详细解决方案

shopnc 二次开发 每天签到积分领取

热度:821   发布时间:2016-04-28 16:51:13.0
shopnc 二次开发 每日签到积分领取

/*

开始shopnc!!!!!

url:xxx.com/index.php?act=index&op=userjf

一个四线城市的半吊子程序员~

实现:前台模板文件 随便加入<a>标签来实现。

*/

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']);}

 

  相关解决方案