Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cof_vip
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
houdong
cof_vip
Commits
b0ad3670
Commit
b0ad3670
authored
Apr 06, 2023
by
houdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vip页面修改
parent
e7fb2ccd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
35 deletions
+103
-35
IndexAction.class.php
app/Lib/Action/Vip/IndexAction.class.php
+32
-7
PkTopAction.class.php
app/Lib/Action/Vip/PkTopAction.class.php
+71
-28
No files found.
app/Lib/Action/Vip/IndexAction.class.php
View file @
b0ad3670
...
...
@@ -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'
=>
$u
serId
])
->
find
();
$wallet
=
M
(
'Wallet'
)
->
where
([
'user_id'
=>
$u
cData
[
'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
(
$order
Int
,
$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
[
$order
Int
]
.
' 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'
);
...
...
app/Lib/Action/Vip/PkTopAction.class.php
View file @
b0ad3670
...
...
@@ -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
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment