Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
wallet
token
Commits
faa89cc0
Commit
faa89cc0
authored
Dec 25, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加释放异常补发脚本
parent
9c88496b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
0 deletions
+68
-0
list.js
backend/web/js/coin-release-member/list.js
+1
-0
AbnormalController.php
console/controllers/AbnormalController.php
+65
-0
DevController.php
console/controllers/DevController.php
+2
-0
No files found.
backend/web/js/coin-release-member/list.js
View file @
faa89cc0
...
@@ -7,6 +7,7 @@ table.render({
...
@@ -7,6 +7,7 @@ table.render({
page
:
1
,
page
:
1
,
limit
:
10
,
limit
:
10
,
cols
:
[[
cols
:
[[
{
field
:
'id'
,
title
:
'用户id'
},
{
field
:
'mobile'
,
title
:
'手机号'
},
{
field
:
'mobile'
,
title
:
'手机号'
},
{
field
:
'coin'
,
title
:
'币种'
},
{
field
:
'coin'
,
title
:
'币种'
},
{
{
...
...
console/controllers/AbnormalController.php
0 → 100644
View file @
faa89cc0
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 2018/12/25
* Time: 14:28
*/
namespace
console\controllers
;
use
common\models\psources\CoinPublish
;
use
common\models\psources\CoinPublishRule
;
use
common\models\psources\CoinReleaseList
;
use
common\models\psources\CoinReleaseMember
;
use
yii\console\Controller
;
class
AbnormalController
extends
Controller
{
//补发解冻
public
function
actionFreeze
(
$member_id
)
{
$coin_release_member
=
CoinReleaseMember
::
find
()
->
where
([
'id'
=>
$member_id
])
->
one
();
if
(
$coin_release_member
){
$coin_publish_rule
=
CoinPublishRule
::
find
()
->
where
([
'id'
=>
$coin_release_member
->
rule_id
])
->
one
();
if
(
!
$coin_publish_rule
)
{
// 计划任务已经被删除
echo
$this
->
id
.
'计划任务已删除'
.
PHP_EOL
;
exit
;
}
$coin_publish
=
CoinPublish
::
findOne
(
$coin_publish_rule
->
pid
);
$address
=
$coin_publish
->
address
;
$change
=
CoinPublishRule
::
calReleaseAmount
(
$coin_publish_rule
->
lock
,
$coin_publish_rule
->
release
,
$coin_publish_rule
->
type
,
$coin_release_member
->
amount
,
$coin_release_member
->
freeze
,
0
);
if
(
$change
>
$coin_release_member
->
freeze
)
{
$change
=
$coin_release_member
->
freeze
;
}
try
{
$trans
=
CoinPublish
::
getDb
()
->
beginTransaction
();
$coin_release_member
->
release
+=
$change
;
$coin_release_member
->
freeze
-=
$change
;
//记录保存到数据库
$list
=
new
CoinReleaseList
();
$list
->
amount
=
$change
;
$list
->
mobile
=
$coin_release_member
->
mobile
;
$list
->
coin
=
$coin_release_member
->
coin
;
$list
->
type
=
2
;
$list
->
status
=
1
;
$list
->
from
=
$address
;
$list
->
mid
=
$coin_release_member
->
id
;
if
(
$coin_release_member
->
save
(
false
)
&&
$list
->
save
(
false
))
{
$trans
->
commit
();
}
echo
date
(
'Y-m-d H:i:s'
)
.
': 释放币成功 [Coin_release_member_id]: '
.
$coin_release_member
->
id
.
PHP_EOL
;
}
catch
(
\Exception
$e
){
$trans
->
rollBack
();
Yii
::
info
(
'释放币失败, [Coin_release_member_id]: '
.
$coin_release_member
->
id
,
__CLASS__
);
echo
date
(
'Y-m-d H:i:s'
)
.
': 释放币失败:'
.
$e
->
getMessage
()
.
PHP_EOL
;
}
}
else
{
echo
"用户不存在"
.
PHP_EOL
;
}
}
}
\ No newline at end of file
console/controllers/DevController.php
View file @
faa89cc0
...
@@ -60,4 +60,6 @@ class DevController extends Controller
...
@@ -60,4 +60,6 @@ class DevController extends Controller
$bty
=
new
Bty
();
$bty
=
new
Bty
();
$bty
->
setQuotation
();
$bty
->
setQuotation
();
}
}
}
}
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