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
fd7392dd
Commit
fd7392dd
authored
Dec 27, 2023
by
houyadong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
富币-全民邀请
parent
54a5d63a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
34 deletions
+86
-34
common.php
app/Common/common.php
+15
-0
PkTopAction.class.php
app/Lib/Action/Vip/PkTopAction.class.php
+15
-34
CofCoinModel.class.php
app/Lib/Model/CofCoinModel.class.php
+56
-0
No files found.
app/Common/common.php
View file @
fd7392dd
...
...
@@ -1648,4 +1648,19 @@ function getSys(){
return
'Other'
;
}
}
/**
* 格式化print_r
* @param mixed $data 数据
* @param bool $flag 是否需要die
* @return mixed
*/
function
p
(
$data
,
$flag
=
true
)
{
echo
'<pre>'
;
print_r
(
$data
);
echo
'</pre>'
;
if
(
$flag
)
{
die
;
}
}
?>
\ No newline at end of file
app/Lib/Action/Vip/PkTopAction.class.php
View file @
fd7392dd
...
...
@@ -380,25 +380,22 @@ class PkTopAction extends IdentityAction{
public
function
join
(){
// $code_type = 35;
$code_type
=
32
;
$mfrom
=
I
(
'mfrom'
,
0
);
$mfrom
=
I
(
'mfrom'
,
0
);
//报名大赛
$mobile
=
I
(
'mobile'
,
''
);
$smsCode
=
I
(
'smsCode'
,
''
);
$referer
=
I
(
'referer'
,
''
);
$inviterId
=
I
(
'inviterId'
,
''
,
intval
);
$referer
=
I
(
'referer'
,
''
);
$inviterId
=
I
(
'inviterId'
,
''
,
intval
);
$targetUrl
=
I
(
'targetUrl'
,
''
);
$targetUrl
=
I
(
'targetUrl'
,
''
);
// var_dump($referer);exit;
//app外打开
if
(
$mobile
){
if
(
!
$smsCode
)
{
if
(
!
$smsCode
)
{
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'请输入手机验证码!'
]);
}
$param
=
[
'mobile'
=>
$mobile
,
'code'
=>
$smsCode
,
'type'
=>
$code_type
];
if
(
D
(
'Sms'
)
->
checkCode
(
$param
)){
}
else
{
if
(
!
D
(
'Sms'
)
->
checkCode
(
$param
)){
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'对不起!手机验证码错误或已过期!'
]);
}
...
...
@@ -410,22 +407,17 @@ class PkTopAction extends IdentityAction{
$ucData
=
$ucUser
[
'data'
];
}
}
else
{
$groupInfo
=
M
(
'Group'
)
->
field
(
'group_id,web_id,category,name,startTime,endTime'
)
->
where
(
array
(
'group_id'
=>
$this
->
GID
))
->
find
();
$groupStatus
=
$this
->
getGroupStatus
(
$groupInfo
);
if
(
$groupStatus
==
3
)
{
$this
->
ajaxReturn
([
'status'
=>
0
,
'info'
=>
'大赛已经结束,不能报名!'
]);
}
if
(
$mfrom
==
1
||
$mfrom
==
2
){
if
(
$mfrom
==
1
||
$mfrom
==
2
){
$userId
=
I
(
'userId'
,
''
,
intval
);
if
(
$mfrom
==
1
){
// $referer=$referer?$referer:'ios_banner';
$referer
=
$referer
?
$referer
:
(
I
(
'place'
)
?
I
(
'place'
)
:
'ios_banner'
);
}
if
(
$mfrom
==
2
){
// $referer=$referer?$referer:'android_banner';
$referer
=
$referer
?
$referer
:
(
I
(
'place'
)
?
I
(
'place'
)
:
'android_banner'
);
}
...
...
@@ -591,7 +583,6 @@ class PkTopAction extends IdentityAction{
return
[
'status'
=>
0
,
'info'
=>
'登录成功'
,
'debug'
=>
$userId
,
'flag'
=>
1
];
}
}
//加入炼股赛用户表
$exist
=
M
(
'PktopUser'
)
->
where
(
array
(
'user_id'
=>
$userId
))
->
find
();
if
(
empty
(
$exist
)){
...
...
@@ -634,7 +625,11 @@ class PkTopAction extends IdentityAction{
D
(
'User'
)
->
finishXunzhang
(
$userId
,
$userName
,
$mobile
,
'cansai'
);
D
(
'Sms'
)
->
send
([
'mobile'
=>
$mobile
,
'content'
=>
$bmContent
,
'type'
=>
46
],
true
,
true
);
#富币任务-全民邀请参赛
if
(
cookie
(
'aid'
)){
D
(
'CofCoin'
)
->
addMoneyForQmShare
(
$userId
,
cookie
(
'aid'
));
cookie
(
'aid'
,
null
);
}
return
[
'status'
=>
1
,
'info'
=>
'参赛成功'
,
'debug'
=>
$userId
];
}
...
...
@@ -1035,24 +1030,13 @@ class PkTopAction extends IdentityAction{
}
//新首页
public
function
index
()
{
//首页的排行榜等切换
// if(!I('viewPage')){
// header('location:'.M_URL.'/Match/jiang');
// exit;
// }
public
function
index
()
{
//邀请人id
if
(
I
(
'aid'
)){
cookie
(
'aid'
,
I
(
'aid'
));
}
$userIdParam
=
I
(
'user_id'
,
''
,
intval
);
// $isapp = I('isapp');
// if ($isapp) {
// $userId = substr($isapp, strpos($isapp, '=') + 1);
// if ($userId) {
// $userIdParam = $userId;
// }
// }
$key
=
I
(
'key'
,
''
);
$key2
=
I
(
'key2'
,
''
);
...
...
@@ -1072,14 +1056,11 @@ class PkTopAction extends IdentityAction{
$userId
=
$userIdParam
;
}
}
//echo $userId;exit;
//app从过来可能没有userName
if
(
$userId
&&
$this
->
user
[
'userName'
]
==
''
)
{
$this
->
setUcLogin
(
$userId
);
}
// $gid = $this->GID;
$groupId
=
$this
->
GID
;
$groupId
=
$this
->
GID
;
$groupInfo
=
M
(
'Group'
)
->
field
(
'group_id,web_id,category,name,startTime,endTime,member_quantity'
)
->
where
([
'group_id'
=>
$groupId
])
->
find
();
$groupStatus
=
$this
->
getGroupStatus
(
$groupInfo
);
...
...
app/Lib/Model/CofCoinModel.class.php
0 → 100644
View file @
fd7392dd
<?php
/**
* 富币体系
*/
class
CofCoinModel
extends
Model
{
public
$autoCheckFields
=
false
;
/** @var int 邀请好友全民炼股参赛成功 */
const
TYPE_INVITA_QM
=
26
;
/**
* 被邀请参加全民后奖励富币
* @param $user_id int 被邀请人用户id
* @param $share_user_id int 邀请人用户id
* @return bool
*/
public
function
addMoneyForQmShare
(
$user_id
,
$share_user_id
)
{
if
(
!
$user_id
||
!
$share_user_id
){
return
false
;
}
$type_info
=
M
(
'CoinType'
)
->
where
([
'type_id'
=>
26
])
->
find
();
if
(
empty
(
$type_info
)){
return
false
;
}
#邀请人的数据
$share_user_info
=
uc_get_user
([
'userId'
=>
$share_user_id
,
'type'
=>
3
]);
if
(
$share_user_info
[
'data'
][
'user_id'
]
!==
$share_user_id
){
return
false
;
}
$share_user_info
=
$share_user_info
[
'data'
];
$my_coin
=
M
(
'CoinUser'
)
->
where
([
'user_id'
=>
$share_user_info
[
'user_id'
]])
->
getField
(
'coin'
);
if
(
$my_coin
===
null
)
{
M
(
'CoinUser'
)
->
add
([
'user_id'
=>
$share_user_info
[
'user_id'
],
'coin'
=>
0
,
'add_time'
=>
time
()]);
}
#富币明细表
M
(
'CoinDetail'
)
->
add
([
'title'
=>
$type_info
[
'type_name'
],
'user_id'
=>
$share_user_info
[
'user_id'
],
'user_name'
=>
$share_user_info
[
'user_name'
],
'mobile'
=>
$share_user_info
[
'mobile'
],
'coin_change'
=>
$type_info
[
'coin'
],
'add_time'
=>
time
(),
'type_id'
=>
self
::
TYPE_INVITA_QM
,
'other_id'
=>
$user_id
,
]);
#富币用户表
M
(
'CoinUser'
)
->
where
([
'user_id'
=>
$share_user_info
[
'user_id'
]])
->
setInc
(
'coin'
,
$type_info
[
'coin'
]);
return
true
;
}
}
?>
\ No newline at end of file
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