Commit b0ad3670 authored by houdong's avatar houdong

vip页面修改

parent e7fb2ccd
......@@ -217,8 +217,26 @@ class IndexAction extends IdentityAction {
$this->assign($rankPage);
$this->setValue($userId);
$this->assign('updateTime',S('clearTime_110'));
$groupInfo=M('Group')->field('web_id,member_quantity')->where(array('group_id'=>$this->GID))->find();
$groupInfo=M('Group')->field('web_id,member_quantity')->where(['group_id'=>$this->GID])->find();
$this->assign('userCount',$groupInfo['member_quantity']);
//取我的排名数据
if($userId){
$tid=$this->GID.'X'.$userId;
$suffix = D('Userinfo')->getTable($this->GID);
$table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a';
$myInfo = M($table, " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$tid])->cache(true,cacheTime())->find();
//取周排行
$where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1];
$weekData = M($table, " ", C('DB_CONFIG_MNCG3'))->where($where)->order('lastweekup desc')->cache(true,cacheTime())->select();
foreach ($weekData as $k=>$v) {
if($v['uid']==$this->GID.'X'.$userId){
$myInfo['weekPhb']=$k+1;
break;
}
}
$this->assign('myInfo',$myInfo);
}
$this->display();
}
......@@ -443,10 +461,10 @@ class IndexAction extends IdentityAction {
}
//加入大赛
// echo $ucData['user_id'];exit;
$joinRes=D('Group')->uc_join_group(array('userId'=>$ucData['user_id'],'userName'=>$ucData['user_name'],'groupId'=>$groupId,'grade'=>0,'teamId'=>$groupId));
$joinRes=D('Group')->uc_join_group(['userId'=>$ucData['user_id'],'userName'=>$ucData['user_name'],'groupId'=>$groupId,'grade'=>0,'teamId'=>$groupId]);
//钱包
$wallet=M('Wallet')->where(['user_id'=>$userId])->find();
$wallet=M('Wallet')->where(['user_id'=>$ucData['user_id']])->find();
if(empty($wallet)){
M('Wallet')->add(['user_id'=>$ucData['user_id'],'user_name'=>$ucData['user_name'],'add_time'=>time()]);
}
......@@ -693,17 +711,24 @@ class IndexAction extends IdentityAction {
//大赛排行榜页面
public function ranking($order,$p,$pageSize){
public function ranking($orderInt,$p,$pageSize){
$MATCH=array(1=>'zongup',2=>'all_balance',3=>'lastweekup',4=>'lastmonthup',5=>'successup',6=>'zhouzup',7=>'cangwei',8=>'huiche');
$order=$MATCH[$order].' desc';
$order=$MATCH[$orderInt].' desc';
//分表归档
$suffix = D('Userinfo')->getTable($this->GID);
$table=$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo a';
$where=array('sex'=>$this->GID,'new_phb'=>['gt',0],'zt'=>1);
//选周盈利时where条件不一样
if($orderInt==3){
$where=['sex'=>$this->GID,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1];
}else{
$where=['sex'=>$this->GID,'new_phb'=>['gt',0],'zt'=>1];
}
//测试时不用缓存->cache(true,cacheTime())
$userRankList = M($table, " ", C('DB_CONFIG_MNCG3'))->where($where)->order($order)->page($p.','.$pageSize)->cache(true,cacheTime())->select();
$userids = [];
......@@ -1267,7 +1292,7 @@ class IndexAction extends IdentityAction {
//获奖心得
$where = ['think' => ['exp', 'is not null and think != ""']];
$thinks = M('PktopUserphb')->where($where)->order('month desc')->limit(6)->select();
$thinks = M('PktopUserphb')->where($where)->order('month desc')->limit(10)->select();
$this->assign('thinks',$thinks);
$this->assign('weixin', 'cofool001');
$this->assign('weixinUrl', 'https://eturl.cn/Rhq2wA?is_head=1');
......
......@@ -1228,20 +1228,19 @@ class PkTopAction extends IdentityAction{
//新首页
public function indexNew() {
//首页的排行榜等切换
if(!I('viewPage')){
header('location:'.M_URL.'/Match/jiang');
exit;
}
// if(!I('viewPage')){
// header('location:'.M_URL.'/Match/jiang');
// exit;
// }
$userIdParam = I('user_id', '', intval);
$isapp = I('isapp');
if ($isapp) {
$userId = substr($isapp, strpos($isapp, '=') + 1);
if ($userId) {
$userIdParam = $userId;
}
}
// $isapp = I('isapp');
// if ($isapp) {
// $userId = substr($isapp, strpos($isapp, '=') + 1);
// if ($userId) {
// $userIdParam = $userId;
// }
// }
$key = I('key', '');
$key2 = I('key2', '');
......@@ -1280,9 +1279,9 @@ class PkTopAction extends IdentityAction{
}
//滚动消息,1pk付款,2发起pk,3pk胜利,4pk失败,5胜利退钱,6失败钱归passive,7买重置卡
$msg1 = M('PktopNews')->where(['type' => ['in', '2']])->order('add_time desc')->limit(5)->select();
$msg2 = M('PktopNews')->where(['type' => ['in', '3']])->order('add_time desc')->limit(5)->select();
$msg = empty($msg2) ? $msg1 : array_merge($msg2, $msg1);
// $msg1 = M('PktopNews')->where(['type' => ['in', '2']])->order('add_time desc')->limit(5)->select();
// $msg2 = M('PktopNews')->where(['type' => ['in', '3']])->order('add_time desc')->limit(5)->select();
// $msg = empty($msg2) ? $msg1 : array_merge($msg2, $msg1);
$lastMonth = date('Y-m', strtotime(date('Y-m-01') . "-1 month"));
......@@ -1303,7 +1302,7 @@ class PkTopAction extends IdentityAction{
//第一个页面显示的数据,公告,心得等
$firstPageData = ['popType' => $popData['popType'], 'popPkUserName' => $popData['popPkUserName'], 'thinks' => $thinks, 'gonggao' => $gonggao];
$return = ['msg' => $msg, 'top10' => $top10,'lastMonthInt' => $lastMonthInt, 'myAllPkCount' => $myAllPkCount];
// $return = ['msg' => $msg, 'top10' => $top10,'lastMonthInt' => $lastMonthInt, 'myAllPkCount' => $myAllPkCount];
$this->assign($firstPageData);
$this->assign($mingrentang);
......@@ -1360,6 +1359,13 @@ class PkTopAction extends IdentityAction{
$this->assign('weixin', $weixin);
$this->assign('weixinUrl', 'https://eturl.cn/Rhq2wA?is_head=1');
//我的成绩
if($userId){
$myData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$this->GID.'X'.$userId])->cache(true,300)->find();
$this->assign('myData',$myData);
}
$this->assign('gid',$gid);
$this->display();
}
......@@ -1371,24 +1377,61 @@ class PkTopAction extends IdentityAction{
$this->display();
}
//大赛排行榜的当前排行页面
public function getWeekPhb(){
$gid=$this->GID;
$order=I('order','lastmonthup');
$p=I('p', 1);
$pageSize=10;
// $pageSize=$gid==$this->GID?10:200;
//分表归档
$suffix = D('Userinfo')->getTable($gid);
$table =$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo';
$where=['sex'=>$gid,'monthzzl'=>['gt',0],'lastweekup'=>['gt',0],'zt'=>1];
$tDataList = M($table, " ", C('DB_CONFIG_MNCG3'))->where($where)->order($order.' desc')->page($p.','.$pageSize)->cache(true,300)->select();
// var_dump($gid);exit;
$uids =[];
foreach ($tDataList as $key => &$rankV) {
$userIDs = explode("X", $rankV['uid']);
$rankV['user_id'] = $userIDs[1];
$uids[] = $userIDs[1];
}
$nick_name_arry =getUser($uids,'nick');////
foreach ($tDataList as $key => &$value) {
$nick_name = $nick_name_arry[$value['user_id']];
$value['user_name'] = $nick_name;
}
//总数目
$totalCount = M($table, " ", C('DB_CONFIG_MNCG3'))->where($where)->cache(true,300)->count();
return [$tDataList,$totalCount];
}
public function phb() {
$p=I('p', 1);
$pageSize=10;
$userId=$this->user['userID'];
//周获奖榜
$maxWeek=M('PktopWeek')->max('week');
$weekPhb=M('PktopWeek')->where(['week'=>$maxWeek])->order('lastweekup desc')->page($p.','.$pageSize)->select();
$uids = array_column('user_id',$weekPhb);
$nickArray =getUser($uids,'nick');
// $maxWeek=M('PktopWeek')->max('week');
// $weekPhb=M('PktopWeek')->where(['week'=>$maxWeek])->order('lastweekup desc')->page($p.','.$pageSize)->select();
// $uids = array_column('user_id',$weekPhb);
// $nickArray =getUser($uids,'nick');
//
// foreach ($weekPhb as $key => &$value) {
// $nickName = $nickArray[$value['user_id']];
// $value['user_name'] = $nickName;
// }
// $this->assign('weekPhb',$weekPhb);
$weekPhb=$this->getWeekPhb();
$this->assign('weekPhb',$weekPhb[0]);
foreach ($weekPhb as $key => &$value) {
$nickName = $nickArray[$value['user_id']];
//$value['user_name'] = $nick_name?$nick_name:$value['username'];
$value['user_name'] = $nickName;
}
$this->assign('weekPhb',$weekPhb);
if($p==1){
//我的排名
$myData = M("userinfo", " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$this->GID.'X'.$userId])->cache(true,300)->find();
......@@ -1398,8 +1441,8 @@ class PkTopAction extends IdentityAction{
}else{
$content = $this->fetch('itemNow');
$totalCount = M('PktopWeek')->where(['week'=>$maxWeek])->count();
$this->ajaxReturn(['status' => 1,'count' =>$totalCount,'data' => $content]);
// $totalCount = M('PktopWeek')->where(['week'=>$maxWeek])->count();
$this->ajaxReturn(['status' => 1,'count' =>$weekPhb[1],'data' => $content]);
}
......
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