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
87b4b7e5
Commit
87b4b7e5
authored
May 22, 2023
by
houdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽奖几率修改
parent
413768f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
77 deletions
+31
-77
IndexAction.class.php
app/Lib/Action/Vip/IndexAction.class.php
+18
-20
PkTopAction.class.php
app/Lib/Action/Vip/PkTopAction.class.php
+13
-57
No files found.
app/Lib/Action/Vip/IndexAction.class.php
View file @
87b4b7e5
...
...
@@ -1135,10 +1135,10 @@ class IndexAction extends IdentityAction {
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'请登录后再操作'
]);
}
$prizeList
=
[
'1'
=>
[
'name'
=>
'100元现金奖励'
,
'score'
=>
10
0
],
'2'
=>
[
'name'
=>
'500元现金奖励'
,
'score'
=>
5
],
'3'
=>
[
'name'
=>
'300元现金奖励'
,
'score'
=>
1
0
],
'4'
=>
[
'name'
=>
'35元现金奖励'
,
'score'
=>
885
]
'1'
=>
[
'name'
=>
'100元现金奖励'
,
'score'
=>
0
],
'2'
=>
[
'name'
=>
'500元现金奖励'
,
'score'
=>
0
],
'3'
=>
[
'name'
=>
'300元现金奖励'
,
'score'
=>
0
],
'4'
=>
[
'name'
=>
'35元现金奖励'
,
'score'
=>
100
]
];
$arr
=
[];
...
...
@@ -1148,7 +1148,7 @@ class IndexAction extends IdentityAction {
$prizeId
=
$this
->
get_rand
(
$arr
);
$prizeName
=
$prizeList
[
$prizeId
][
'name'
];
$insertData
=
[
'user_id'
=>
$userId
,
'user_name'
=>
$this
->
user
[
'userName'
],
'prize'
=>
$prizeName
,
'add_time'
=>
time
()];
$insertData
=
[
'user_id'
=>
$userId
,
'user_name'
=>
$this
->
user
[
'userName'
],
'prize'
=>
$prizeName
,
'add_time'
=>
time
()
,
'group_id'
=>
$this
->
GID
];
M
(
'PktopLuckydog'
)
->
add
(
$insertData
);
$this
->
ajaxReturn
([
'status'
=>
1
,
'info'
=>
''
,
'name'
=>
$prizeName
,
'place'
=>
$prizeId
]);
...
...
@@ -1184,7 +1184,7 @@ class IndexAction extends IdentityAction {
// $this->ajaxReturn(['status' =>0,'info'=>'每月1日至7日才能抽奖']);
}
//每人每个月只能抽一次奖
$oldDog
=
M
(
'PktopLuckydog'
)
->
where
([
'user_id'
=>
$userId
])
->
order
(
'add_time desc'
)
->
find
();
$oldDog
=
M
(
'PktopLuckydog'
)
->
where
([
'user_id'
=>
$userId
,
'group_id'
=>
$this
->
GID
])
->
order
(
'add_time desc'
)
->
find
();
// if(!empty($oldDog)&&date('Y-m',$oldDog['add_time'])==date('Y-m')){
// $this->ajaxReturn(['status' =>0,'info'=>'您当月已经抽奖']);
// }
...
...
@@ -1208,16 +1208,14 @@ class IndexAction extends IdentityAction {
//这个月剩余的抽奖机会数量
public
function
getLeftCjNum
()
{
// if(date('d')>7){
// return 0;
// }
$userId
=
$this
->
user
[
'userID'
];
$userId
=
$this
->
user
[
'userID'
];
$kaihuStatus
=
M
()
->
db
(
10
,
C
(
'DB_CONFIG_DEMO'
))
->
table
(
'cofool_pktop_kaihu'
)
->
where
([
'user_id'
=>
$userId
])
->
find
();
if
(
empty
(
$kaihuStatus
)){
return
0
;
}
$oldDog
=
M
()
->
db
(
10
,
C
(
'DB_CONFIG_DEMO'
))
->
table
(
'cofool_pktop_luckydog'
)
->
where
([
'user_id'
=>
$userId
])
->
order
(
'add_time desc'
)
->
find
();
$where
=
[
'user_id'
=>
$userId
,
'group_id'
=>
$this
->
GID
];
$oldDog
=
M
()
->
db
(
10
,
C
(
'DB_CONFIG_DEMO'
))
->
table
(
'cofool_pktop_luckydog'
)
->
where
(
$where
)
->
order
(
'add_time desc'
)
->
find
();
// if(!empty($oldDog)&&date('Y-m',$oldDog['add_time'])==date('Y-m')){
// return 0;
// }
...
...
@@ -1235,15 +1233,15 @@ class IndexAction extends IdentityAction {
}
//官方有奖赛列表页
public
function
moreDs
(){
$userId
=
$this
->
user
[
'userID'
];
$this
->
setValue
(
$userId
);
$this
->
assign
(
'gid'
,
$this
->
GID
);
$gList
=
D
(
'Niu'
)
->
getMoreDs
(
$userId
,
'www'
);
$this
->
assign
(
'gList'
,
$gList
);
$this
->
dianjiLog
();
$this
->
display
();
}
//
public function moreDs(){
//
$userId=$this->user['userID'];
//
$this->setValue($userId);
//
$this->assign('gid',$this->GID);
//
$gList=D('Niu')->getMoreDs($userId,'www');
//
$this->assign('gList',$gList);
//
$this->dianjiLog();
//
$this->display();
//
}
public
function
dianjiLog
(){
$gid
=
$this
->
GID
;
...
...
app/Lib/Action/Vip/PkTopAction.class.php
View file @
87b4b7e5
...
...
@@ -182,34 +182,6 @@ class PkTopAction extends IdentityAction{
// var_dump(DB_USER);exit;
$this
->
assign
(
'finalList'
,
$finalList
[
'finalList'
]);
//获奖名单,取前18名,暂不需要决赛名单
// $suffix = D('Userinfo')->getTable(FINALS_GROUP);
// $table =$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo';
// $where=array('sex'=>FINALS_GROUP,'new_phb'=>array('gt',0),'zt'=>1,'monthzzl'=>['gt',150]);
// $finalWinList = M($table, " ", C('DB_CONFIG_MNCG3'))->where($where)->order('zongup desc')->limit(18)->select();
//取昵称
// $userids = array();
// foreach ($finalWinList as $key => $f) {
// $userIDs = explode("X", $f['uid']);
// $userids[] = $userIDs[1];
// }
// $nick_name_arry =getUser($userids,'nick');
// foreach ($finalWinList as $key => &$w) {
// $userIDs = explode("X", $w['uid']);
// $w['user_id'] = $userIDs[1];
//// $nick_name = $nick_name_arry[$userIDs[1]];
// $w['username'] = $nick_name?$nick_name:$w['username'];
// }
// $top123[]=array_shift($finalWinList);
// $top123[]=array_shift($finalWinList);
// $top123[]=array_shift($finalWinList);
// $this->assign('top123',$top123);
// $this->assign('finalWinList',$finalWinList);
// $share=array('groupId'=>$groupId,'groupStatus'=>$groupStatus,'viewPage'=>2,
// 'close_tips'=>'','userID'=>'XXXXXX','zhuangtai'=>$this->STATUS_TXT[$groupStatus]);
$share
=
array
(
'groupId'
=>
$groupId
,
'groupStatus'
=>
$groupStatus
,
'viewPage'
=>
2
,
'statusInt'
=>
$groupStatus
,
...
...
@@ -1158,10 +1130,8 @@ class PkTopAction extends IdentityAction{
// $this->ajaxReturn(['status' =>0,'info'=>'每月1日至7日才能抽奖']);
}
//每人每个月只能抽一次奖,改成只能抽一次奖
$oldDog
=
M
(
'PktopLuckydog'
)
->
where
([
'user_id'
=>
$userId
])
->
order
(
'add_time desc'
)
->
find
();
// if(!empty($oldDog)&&date('Y-m',$oldDog['add_time'])==date('Y-m')){
// $this->ajaxReturn(['status' =>0,'info'=>'您当月已经抽奖']);
// }
$oldDog
=
M
(
'PktopLuckydog'
)
->
where
([
'user_id'
=>
$userId
,
'group_id'
=>
$this
->
GID
])
->
order
(
'add_time desc'
)
->
find
();
if
(
!
empty
(
$oldDog
)){
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'您已经抽过奖了'
,
'uid'
=>
$userId
]);
}
...
...
@@ -1173,26 +1143,22 @@ class PkTopAction extends IdentityAction{
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'请联系管理员获取抽奖次数'
,
'uid'
=>
$userId
]);
}
$suffix
=
D
(
'Userinfo'
)
->
getTable
(
$this
->
GID
);
$table
=
$suffix
?
'mncg_archive.userinfo'
.
$suffix
:
'mncg.userinfo'
;
$lastmonthup
=
M
(
$table
,
" "
,
C
(
'DB_CONFIG_MNCG3'
))
->
where
([
'uid'
=>
$this
->
GID
.
'X'
.
$userId
])
->
getField
(
'lastmonthup'
);
if
(
$lastmonthup
<=
0
){
// $this->ajaxReturn(['status' =>0,'info'=>'上月收益必须大于0才能抽奖']);
}
$this
->
ajaxReturn
([
'status'
=>
1
,
'info'
=>
''
,
'uid'
=>
$userId
]);
}
//取奖品
public
function
getLucky
()
{
$userId
=
$this
->
user
[
'userID'
];
$userName
=
$this
->
user
[
'userName'
];
if
(
$userId
==
0
){
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'请登录后再操作'
]);
}
$prizeList
=
[
'1'
=>
[
'name'
=>
'100元现金奖励'
,
'score'
=>
10
0
],
'2'
=>
[
'name'
=>
'500元现金奖励'
,
'score'
=>
5
],
'3'
=>
[
'name'
=>
'300元现金奖励'
,
'score'
=>
1
0
],
'4'
=>
[
'name'
=>
'35元现金奖励'
,
'score'
=>
885
]
'1'
=>
[
'name'
=>
'100元现金奖励'
,
'score'
=>
0
],
'2'
=>
[
'name'
=>
'500元现金奖励'
,
'score'
=>
0
],
'3'
=>
[
'name'
=>
'300元现金奖励'
,
'score'
=>
0
],
'4'
=>
[
'name'
=>
'35元现金奖励'
,
'score'
=>
100
]
];
$arr
=
[];
...
...
@@ -1202,7 +1168,7 @@ class PkTopAction extends IdentityAction{
$prizeId
=
$this
->
get_rand
(
$arr
);
$prizeName
=
$prizeList
[
$prizeId
][
'name'
];
$insertData
=
[
'user_id'
=>
$userId
,
'user_name'
=>
$
this
->
user
[
'userName'
],
'prize'
=>
$prizeName
,
'add_time'
=>
time
()
];
$insertData
=
[
'user_id'
=>
$userId
,
'user_name'
=>
$
userName
,
'prize'
=>
$prizeName
,
'add_time'
=>
time
(),
'group_id'
=>
$this
->
GID
];
M
(
'PktopLuckydog'
)
->
add
(
$insertData
);
$this
->
ajaxReturn
([
'status'
=>
1
,
'info'
=>
''
,
'name'
=>
$prizeName
,
'place'
=>
$prizeId
]);
...
...
@@ -1229,30 +1195,20 @@ class PkTopAction extends IdentityAction{
//这个月剩余的抽奖机会数量
public
function
getLeftCjNum
()
{
// if(date('d')>7){
// return 0;
// }
$userId
=
$this
->
user
[
'userID'
];
$kaihuStatus
=
M
()
->
db
(
1
,
C
(
'DB_CONFIG_DEMO'
))
->
table
(
'cofool_pktop_kaihu'
)
->
where
([
'user_id'
=>
$userId
])
->
find
();
if
(
$userId
==
4098647
){
// var_dump(M('PktopKaihu')->getLastSql());exit;
}
if
(
empty
(
$kaihuStatus
)){
return
0
;
}
$oldDog
=
M
()
->
db
(
1
,
C
(
'DB_CONFIG_DEMO'
))
->
table
(
'cofool_pktop_luckydog'
)
->
where
([
'user_id'
=>
$userId
])
->
order
(
'add_time desc'
)
->
find
();
// $tj=!empty($oldDog)&&date('Y-m',$oldDog['add_time'])==date('Y-m');
// $where=['user_id'=>$userId];
$where
=
[
'user_id'
=>
$userId
,
'group_id'
=>
$this
->
GID
];
$oldDog
=
M
()
->
db
(
1
,
C
(
'DB_CONFIG_DEMO'
))
->
table
(
'cofool_pktop_luckydog'
)
->
where
(
$where
)
->
order
(
'add_time desc'
)
->
find
();
$tj
=!
empty
(
$oldDog
);
if
(
$tj
){
return
0
;
}
// $suffix = D('Userinfo')->getTable($this->GID);
// $table =$suffix?'mncg_archive.userinfo'.$suffix:'mncg.userinfo';
// $lastmonthup = M($table, " ", C('DB_CONFIG_MNCG3'))->where(['uid'=>$this->GID.'X'.$userId])->getField('lastmonthup');
// if($lastmonthup<=0){
// return 0;
// }
return
1
;
}
...
...
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