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
312b87c1
Commit
312b87c1
authored
Dec 27, 2023
by
houyadong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
富币-参加全民奖励
parent
987d2ffe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
4 deletions
+50
-4
PkTopAction.class.php
app/Lib/Action/Vip/PkTopAction.class.php
+1
-1
CofCoinModel.class.php
app/Lib/Model/CofCoinModel.class.php
+49
-3
No files found.
app/Lib/Action/Vip/PkTopAction.class.php
View file @
312b87c1
...
...
@@ -626,8 +626,8 @@ class PkTopAction extends IdentityAction{
D
(
'Sms'
)
->
send
([
'mobile'
=>
$mobile
,
'content'
=>
$bmContent
,
'type'
=>
46
],
true
,
true
);
#富币任务-全民邀请参赛
D
(
'CofCoin'
)
->
addMoneyForQmJoin
(
$userId
,
cookie
(
'aid'
));
if
(
cookie
(
'aid'
)){
D
(
'CofCoin'
)
->
addMoneyForQmShare
(
$userId
,
cookie
(
'aid'
));
cookie
(
'aid'
,
null
);
}
return
[
'status'
=>
1
,
'info'
=>
'参赛成功'
,
'debug'
=>
$userId
];
...
...
app/Lib/Model/CofCoinModel.class.php
View file @
312b87c1
...
...
@@ -7,22 +7,25 @@ class CofCoinModel extends Model
{
public
$autoCheckFields
=
false
;
/** @var int 参加全民分赛场 */
const
TYPE_QM_ENTRY
=
24
;
/** @var int 邀请好友全民炼股参赛成功 */
const
TYPE_INVITA_QM
=
26
;
/**
* 被邀请参加全民后奖励富币
*
任务-
被邀请参加全民后奖励富币
* @param $user_id int 被邀请人用户id
* @param $share_user_id int 邀请人用户id
* @return bool
*/
p
ublic
function
addMoneyForQmShare
(
$user_id
,
$share_user_id
)
p
rivate
function
addMoneyForQmShare
(
$user_id
,
$share_user_id
=
0
)
{
if
(
!
$user_id
||
!
$share_user_id
){
return
false
;
}
$type_info
=
M
(
'CoinType'
)
->
where
([
'type_id'
=>
26
])
->
find
();
$type_info
=
M
(
'CoinType'
)
->
where
([
'type_id'
=>
self
::
TYPE_INVITA_QM
])
->
find
();
if
(
empty
(
$type_info
)){
return
false
;
}
...
...
@@ -51,6 +54,49 @@ class CofCoinModel extends Model
M
(
'CoinUser'
)
->
where
([
'user_id'
=>
$share_user_info
[
'user_id'
]])
->
setInc
(
'coin'
,
$type_info
[
'coin'
]);
return
true
;
}
/**
* 任务-参加全民分赛场
* @param $user_id
* @return bool
*/
public
function
addMoneyForQmJoin
(
$user_id
,
$share_user_id
=
0
)
{
if
(
!
$user_id
){
return
false
;
}
$type_info
=
M
(
'CoinType'
)
->
where
([
'type_id'
=>
self
::
TYPE_QM_ENTRY
])
->
find
();
if
(
empty
(
$type_info
)){
return
false
;
}
#参赛人信息
$user_info
=
uc_get_user
([
'userId'
=>
$user_id
,
'type'
=>
3
]);
if
(
$user_info
[
'data'
][
'user_id'
]
!==
$user_id
){
return
false
;
}
$user_info
=
$user_info
[
'data'
];
$my_coin
=
M
(
'CoinUser'
)
->
where
([
'user_id'
=>
$user_id
])
->
getField
(
'coin'
);
if
(
$my_coin
===
null
)
{
M
(
'CoinUser'
)
->
add
([
'user_id'
=>
$user_id
,
'coin'
=>
0
,
'add_time'
=>
time
()]);
}
#富币明细表
M
(
'CoinDetail'
)
->
add
([
'title'
=>
$type_info
[
'type_name'
],
'user_id'
=>
$user_id
,
'user_name'
=>
$user_info
[
'user_name'
],
'mobile'
=>
$user_info
[
'mobile'
],
'coin_change'
=>
$type_info
[
'coin'
],
'add_time'
=>
time
(),
'type_id'
=>
self
::
TYPE_QM_ENTRY
,
]);
#富币用户表
M
(
'CoinUser'
)
->
where
([
'user_id'
=>
$user_id
])
->
setInc
(
'coin'
,
$type_info
[
'coin'
]);
if
(
$share_user_id
){
$this
->
addMoneyForQmShare
(
$user_id
,
$share_user_id
);
}
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