Commit c5eeff40 authored by houdong's avatar houdong

记录点击大赛列表的日志

parent e8c92d20
...@@ -1169,9 +1169,24 @@ class IndexAction extends IdentityAction { ...@@ -1169,9 +1169,24 @@ class IndexAction extends IdentityAction {
$this->assign('gid',$this->GID); $this->assign('gid',$this->GID);
$gList=D('Niu')->getMoreDs($userId,'www'); $gList=D('Niu')->getMoreDs($userId,'www');
$this->assign('gList',$gList); $this->assign('gList',$gList);
$this->dianjiLog();
$this->display(); $this->display();
} }
public function dianjiLog(){
$gid=$this->GID;
$userId=$this->user['userID'];
if($userId){
$where=['user_id'=>$userId,'add_time'=>['egt',strtotime('today')],'model'=>MODULE_NAME,'action'=>'moreDs','param1'=>$gid];
$count = M('ClickLog')->where($where)->count();
if(!$count){
$data=['user_id'=>$userId,'user_name'=>$this->user['userName'],'model'=>MODULE_NAME,'action'=>'moreDs',
'add_time'=>time(),'client'=>'WindowsPc','day'=>date('Ymd',time()),'param1'=>$gid];
M('ClickLog')->add($data);
}
}
}
// public function bmOtherGroup(){ // public function bmOtherGroup(){
// $userId = $this->user['userID']; // $userId = $this->user['userID'];
// $userName = $this->user['userName']; // $userName = $this->user['userName'];
......
...@@ -1222,6 +1222,22 @@ class PkTopAction extends IdentityAction{ ...@@ -1222,6 +1222,22 @@ class PkTopAction extends IdentityAction{
$this->ajaxReturn(['status' => 1, 'joinStatus' =>$res[0],'userId'=>$userId,'debug'=>$res[0],'info'=>$info]); $this->ajaxReturn(['status' => 1, 'joinStatus' =>$res[0],'userId'=>$userId,'debug'=>$res[0],'info'=>$info]);
} }
public function dianjiLog(){
$gid=$this->GID;
$userId=$this->user['userID'];
if($userId){
$where=['user_id'=>$userId,'add_time'=>['egt',strtotime('today')],'model'=>MODULE_NAME,'action'=>'moreDs','param1'=>$gid];
$count = M('ClickLog')->where($where)->count();
if(!$count){
$data=['user_id'=>$userId,'user_name'=>$this->user['userName'],'model'=>MODULE_NAME,'action'=>'moreDs',
'add_time'=>time(),'client'=>getSys(),'day'=>date('Ymd',time()),'param1'=>$gid];
M('ClickLog')->add($data);
}
}
$this->ajaxReturn(['status'=>1,'debug'=>'用户id:'.$userId.',旧数据条数'.$count]);
}
} }
?> ?>
......
...@@ -443,9 +443,15 @@ ...@@ -443,9 +443,15 @@
// if(i == 1){ // if(i == 1){
// slider.reloadSlider(); // slider.reloadSlider();
// } // }
if(i==2){
$('.selectNow').eq(1).click();
}
//点击量统计
if(i==3){ if(i==3){
$.get('/PkTop/dianjiLog',{},function(e){
console.log('记录点击日志');
},'json');
$('.selectNow').eq(1).click();
} }
}) })
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment