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
fc15d2de
Commit
fc15d2de
authored
Sep 18, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7f2e58c0
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
423 additions
and
25 deletions
+423
-25
CoinPublishController.php
backend/controllers/CoinPublishController.php
+10
-1
CoinPublishRuleController.php
backend/controllers/CoinPublishRuleController.php
+15
-4
ExtractTokenJob.php
backend/jobs/ExtractTokenJob.php
+96
-0
list.php
backend/views/coin-publish-rule/list.php
+2
-1
list.js
backend/web/js/coin-publish/list.js
+9
-7
Chain33Business.php
common/business/Chain33Business.php
+104
-0
params-local.php
common/config/params-local.php
+5
-0
params.php
common/config/params.php
+0
-2
CoinReleaseCheck.php
common/models/psources/CoinReleaseCheck.php
+35
-6
CoinReleaseMember.php
common/models/psources/CoinReleaseMember.php
+8
-4
Chain33Service.php
common/service/chain33/Chain33Service.php
+130
-0
DevController.php
console/controllers/DevController.php
+9
-0
No files found.
backend/controllers/CoinPublishController.php
View file @
fc15d2de
<?php
/**
* Created By Sublime Text 3
*
* @author rlgyzhcn <rlgyzhcn@qq.com>
*/
namespace
backend\controllers
;
use
common\business\Chain33Business
;
use
Yii
;
use
backend\models\coin\CoinPublishForm
;
use
common\models\psources\CoinPublish
;
...
...
@@ -24,9 +26,16 @@ class CoinPublishController extends BaseController
$role_self
=
current
(
$auth
->
getRolesByUser
(
Yii
::
$app
->
user
->
id
));
$child_roles
=
$auth
->
getChildRoles
(
$role_self
->
name
);
$userful_roles
=
array_keys
(
$child_roles
);
// var_dump($userful_roles);die();
$condition
[]
=
[
'in'
,
'owner'
,
$userful_roles
];
$data
=
CoinPublish
::
getList
(
$page
,
$limit
,
$condition
);
//获取热钱包数量
if
(
$data
[
'code'
]
==
0
&&
!
empty
(
$data
[
'data'
]))
{
$list
=
&
$data
[
'data'
];
$amount
=
Chain33Business
::
getMulAccountTokenAssets
(
$list
);
foreach
(
$list
as
$k
=>
&
$v
)
{
$v
[
'amount'
]
=
$amount
[
$v
[
'id'
]];
}
}
return
$data
;
}
return
$this
->
render
(
'list'
);
...
...
backend/controllers/CoinPublishRuleController.php
View file @
fc15d2de
...
...
@@ -7,11 +7,12 @@
namespace
backend\controllers
;
use
Yii
;
use
backend\jobs\FreezeJob
;
use
common\models\psources\CoinPublish
;
use
common\models\psources\CoinPublishRule
;
use
common\models\psources\CoinReleaseMember
;
use
Yii
;
use
common\business\Chain33Business
;
class
CoinPublishRuleController
extends
BaseController
{
...
...
@@ -78,11 +79,20 @@ class CoinPublishRuleController extends BaseController
$data
[
'data'
]
=
$models
;
return
$data
;
}
$coin
=
CoinPublish
::
findOne
(
$pid
);
$amount
=
Chain33Business
::
getAccountTokenAssets
(
$coin
->
address
,
$coin
->
coin_name_en
);
// var_dump($amount);die();
if
(
$amount
[
'code'
]
==
0
)
{
$amount
=
$amount
[
'amount'
];
}
else
{
$amount
=
'error'
;
}
//获取热钱包数量
return
$this
->
render
(
'list'
,
[
'coin_name'
=>
$coin
->
coin_name_en
??
''
,
'amount'
=>
100090000
,
'amount'
=>
$amount
,
'release_amount'
=>
CoinPublishRule
::
getReleaseAmountThisMonthById
(
$pid
),
'address'
=>
$coin
->
address
??
''
,
]);
...
...
@@ -111,7 +121,7 @@ class CoinPublishRuleController extends BaseController
->
asArray
()
->
One
();
if
(
$form_database
)
{
$sid
=
(
int
)
$form_database
[
'sid'
]
+
1
;
$sid
=
(
int
)
$form_database
[
'sid'
]
+
1
;
}
else
{
$sid
=
$prefix
.
'001'
;
}
...
...
@@ -120,7 +130,7 @@ class CoinPublishRuleController extends BaseController
}
if
(
$model
->
load
(
$post
)
&&
$model
->
validate
())
{
if
(
CoinPublishRule
::
SCENARIOS_ADD
==
$model
->
scenario
)
{
$model
->
sid
=
(
string
)
$sid
;
$model
->
sid
=
(
string
)
$sid
;
}
$model
->
release_time
=
date_create_from_format
(
self
::
DATE_FORMAT
[
$model
->
repeat
],
$model
->
release_time
)
->
format
(
'Y-m-d H:i:s'
);
...
...
@@ -176,6 +186,7 @@ class CoinPublishRuleController extends BaseController
/**
* 获取id
*
* @return int
*/
private
function
getPid
()
...
...
backend/jobs/ExtractTokenJob.php
0 → 100644
View file @
fc15d2de
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-9-18
* Time: 下午2:50
*/
namespace
backend\jobs
;
use
Yii
;
use
yii\queue\JobInterface
;
use
yii\queue\Queue
;
use
yii\base\BaseObject
;
use
common\models\psources\CoinReleaseCheck
;
use
common\models\psources\CoinReleaseMember
;
use
common\models\psources\CoinPublishRule
;
use
common\models\psources\CoinPublish
;
use
common\business\Chain33Business
;
/**
* Class ExtractTokenJob
* 提币任务
*
* @package backend\jobs
*/
class
ExtractTokenJob
extends
BaseObject
implements
JobInterface
{
/**
* 提币申请id
*
* @var int $cid
*/
public
$cid
=
0
;
/**
* @param Queue $queue which pushed and is handling the job
* @return integer
*/
public
function
execute
(
$queue
)
{
//获取申请
$apply
=
CoinReleaseCheck
::
findOne
(
$this
->
cid
);
if
(
$apply
)
{
$assets
=
CoinReleaseMember
::
findOne
(
$apply
->
uid
);
if
(
$assets
)
{
$release
=
$assets
->
release
;
if
(
$release
>=
$apply
->
amount
)
{
//提币
$amount
=
$apply
->
amount
/
1e8
;
//获取提币地址
$from
=
''
;
$coin_publish_rule
=
CoinPublishRule
::
findOne
(
$assets
->
rule_id
);
if
(
$coin_publish_rule
)
{
$coin_publish
=
CoinPublish
::
findOne
(
$coin_publish_rule
->
pid
);
if
(
$coin_publish
)
{
$from
=
$coin_publish
->
address
;
}
}
if
(
!
empty
(
$from
))
{
$result
=
Chain33Business
::
extractToken
(
$from
,
$apply
->
to_address
,
$amount
,
''
,
true
,
$apply
->
coin
);
if
(
$result
[
'code'
]
==
0
)
{
$assets
->
release
-=
$amount
;
$assets
->
output
+=
$amount
;
if
(
$assets
->
save
())
{
//提币成功
$apply
->
status
=
CoinReleaseCheck
::
STATUS_PADDING
;
//提币中
if
(
$apply
->
save
())
{
Yii
::
info
(
"提币成功: [申请id]:
$this->cid
"
,
__CLASS__
);
}
Yii
::
warning
(
"提币申请状态修改失败: [申请id]:
$this->cid
"
,
__CLASS__
);
}
else
{
Yii
::
warning
(
"减少用户资产失败: [申请id]:
$this->cid
, [资产]:
$amount
"
,
__CLASS__
);
}
}
else
{
var_dump
(
$result
);
Yii
::
info
(
"提币失败:
{
$result
[
'msg'
]
}
! [申请id]:
$this->cid
"
,
__CLASS__
);
}
}
else
{
Yii
::
info
(
"提币失败: 提币地址不存在! [申请id]:
$this->cid
"
,
__CLASS__
);
}
}
else
{
Yii
::
info
(
"提币失败: 用户资产不足! [申请id]:
$this->cid
"
,
__CLASS__
);
}
}
else
{
Yii
::
info
(
"提币失败: 用户资产信息不存在! [申请id]:
$this->cid
"
,
__CLASS__
);
}
}
else
{
Yii
::
info
(
"提币失败: 提币申请不存在! [申请id]:
$this->cid
"
,
__CLASS__
);
}
return
0
;
}
}
\ No newline at end of file
backend/views/coin-publish-rule/list.php
View file @
fc15d2de
...
...
@@ -6,6 +6,7 @@
*/
use
backend\assets\coinPublishRule\ListAsset
;
ListAsset
::
register
(
$this
);
?>
...
...
@@ -21,7 +22,7 @@ ListAsset::register($this);
<tbody>
<tr>
<td>
<?=
$coin_name
?>
</td>
<td>
<?=
$amount
?>
</td>
<td>
<?=
$amount
/
1e8
?>
</td>
<td>
<?=
$release_amount
?>
</td>
<td>
<?=
$address
?>
</td>
</tr>
...
...
backend/web/js/coin-publish/list.js
View file @
fc15d2de
...
...
@@ -12,11 +12,15 @@ table.render({
{
field
:
'coin_name_zh'
,
title
:
'币种中文名'
},
{
field
:
'coin_name_en'
,
title
:
'币种英文名'
},
{
field
:
'address'
,
title
:
'热钱包地址'
},
{
field
:
'amount'
,
title
:
'热钱包数量'
},
{
field
:
'amount'
,
title
:
'热钱包数量'
,
templet
:
function
(
d
)
{
return
d
.
amount
/
1
e8
;
}
},
{
toolbar
:
'#toolbar'
,
title
:
'操作'
}
]],
});
table
.
on
(
'tool(table1)'
,
function
(
obj
)
{
table
.
on
(
'tool(table1)'
,
function
(
obj
)
{
var
event
=
obj
.
event
;
var
data
=
obj
.
data
;
if
(
'update'
==
event
)
{
...
...
@@ -34,7 +38,6 @@ table.on('tool(table1)', function(obj){
var
coin_name_zh
=
$
(
'#addData input[name="coin_name_zh"]'
).
val
();
var
coin_name_en
=
$
(
'#addData input[name="coin_name_en"]'
).
val
();
if
(
company_name
!==
""
&&
company_name
!==
""
&&
coin_name_en
!==
""
)
{
$btn
=
$
(
'.layui-layer-btn0'
).
button
(
'loading'
);
$
.
post
(
'/admin/coin-publish/add'
,
$
(
"#addData"
).
serialize
(),
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
rev
.
code
==
0
)
{
...
...
@@ -42,7 +45,6 @@ table.on('tool(table1)', function(obj){
table
.
reload
(
"table1"
,
{});
}
});
$btn
.
button
(
'reset'
);
}
else
{
layer
.
msg
(
"请输入完整!"
);
}
...
...
@@ -51,9 +53,9 @@ table.on('tool(table1)', function(obj){
});
layui
.
form
.
render
();
});
}
else
if
(
'del'
==
event
)
{
layer
.
confirm
(
'确定删除此币种监控吗?'
,
{
title
:
'删除币种'
},
function
(
index
)
{
$
.
get
(
'/admin/coin-publish/del'
,
{
id
:
data
.
id
},
function
(
rev
)
{
}
else
if
(
'del'
==
event
)
{
layer
.
confirm
(
'确定删除此币种监控吗?'
,
{
title
:
'删除币种'
},
function
(
index
)
{
$
.
get
(
'/admin/coin-publish/del'
,
{
id
:
data
.
id
},
function
(
rev
)
{
if
(
rev
.
code
==
0
)
{
obj
.
del
();
layer
.
close
(
index
);
...
...
common/business/Chain33Business.php
0 → 100644
View file @
fc15d2de
<?php
/**
* Created By Sublime Text 3
*
* @date 2018-09-18 10:21:53
* @authors rlgy <rlgyzhcn@qq.com>
*/
namespace
common\business
;
use
common\service\chain33\Chain33Service
;
/**
* chain33 区块链接口
*/
class
Chain33Business
{
/**
* 查询地址下的token合约下的token资产
*
* @param string $token
* @param string $address
* @return array
*/
public
static
function
getAccountTokenAssets
(
$address
,
$token
)
{
$service
=
new
Chain33Service
();
$result
=
$service
->
getAccountTokenAssets
(
$address
,
$token
);
if
(
$result
[
'code'
]
==
0
)
{
$result
=
$result
[
'result'
];
if
(
isset
(
$result
[
'tokenAssets'
]))
{
$tokenAssets
=
$result
[
'tokenAssets'
];
$tokenAssets
=
array_column
(
$tokenAssets
,
null
,
'symbol'
);
if
(
isset
(
$tokenAssets
[
$token
]))
{
return
[
'code'
=>
0
,
'amount'
=>
$tokenAssets
[
$token
][
'account'
][
'balance'
]];
}
return
[
'code'
=>
-
1
,
'msg'
=>
"
$token
不存在"
];
}
return
[
'code'
=>
-
1
,
'msg'
=>
'资产信息不存在'
];
}
return
$result
;
}
/**
* 批量获取token资产
*
* @param array $list
* @return array
*/
public
static
function
getMulAccountTokenAssets
(
$list
)
{
foreach
(
$list
as
$k
=>
&
$v
)
{
$temp
=
self
::
getAccountTokenAssets
(
$v
[
'address'
],
$v
[
'coin_name_en'
]);
if
(
$temp
[
'code'
]
==
0
)
{
$v
[
'amount'
]
=
$temp
[
'amount'
];
}
else
{
$v
[
'amount'
]
=
0
;
}
}
return
array_column
(
$list
,
'amount'
,
'id'
);
}
/**
* 提币接口
*
* @param $from
* @param $to
* @param $amount
* @param string $note
* @param bool $isToken
* @param string $tokenSymbol
* @return array|string
*/
public
static
function
extractToken
(
$from
,
$to
,
$amount
,
$note
=
""
,
$isToken
=
true
,
$tokenSymbol
=
""
)
{
$service
=
new
Chain33Service
();
$result
=
$service
->
extractToken
(
$from
,
$to
,
$amount
,
$note
,
$isToken
,
$tokenSymbol
);
if
(
$result
[
'code'
]
==
0
)
{
return
$result
[
'result'
][
'hash'
];
}
return
[
'code'
=>
-
1
,
'msg'
=>
$result
[
'msg'
]];
}
/**
* 转账接口
*
* @param $from
* @param $to
* @param $amount
* @param string $note
* @param bool $isToken
* @param string $tokenSymbol
* @return array|string
*/
public
static
function
transToken
(
$from
,
$to
,
$amount
,
$note
=
""
,
$isToken
=
true
,
$tokenSymbol
=
""
)
{
$service
=
new
Chain33Service
();
$result
=
$service
->
extractToken
(
$from
,
$to
,
$amount
,
$note
,
$isToken
,
$tokenSymbol
);
if
(
$result
[
'code'
]
==
0
)
{
return
$result
[
'result'
][
'hash'
];
}
return
[
'code'
=>
-
1
,
'msg'
=>
$result
[
'msg'
]];
}
}
common/config/params-local.php
View file @
fc15d2de
...
...
@@ -7,4 +7,9 @@
*/
return
[
'chain33'
=>
[
'scheme'
=>
'http'
,
'host'
=>
'114.55.101.159'
,
'port'
=>
8801
,
],
];
common/config/params.php
View file @
fc15d2de
<?php
$chain_url
=
"121.196.205.182:45656"
;
return
[
'adminEmail'
=>
'admin@example.com'
,
'supportEmail'
=>
'support@example.com'
,
...
...
common/models/psources/CoinReleaseCheck.php
View file @
fc15d2de
...
...
@@ -16,14 +16,15 @@ use Yii;
* @property integer $uid
* @property string $mobile
* @property string $coin
* @property double $amount
* @property string $to_address
* @property integer $check_first_status
* @property integer $check_first_uid
* @property integer $check_second_status
* @property integer $check_second_uid
* @property integer $status
* @property s
rting
$create_time
* @property s
rting
$update_time
* @property s
tring
$create_time
* @property s
tring
$update_time
*/
class
CoinReleaseCheck
extends
BaseActiveRecord
{
...
...
@@ -86,18 +87,46 @@ class CoinReleaseCheck extends BaseActiveRecord
{
return
[
self
::
SCENARIOS_CHECK
=>
[
'coin'
,
'start_time'
,
'end_time'
,
'mobile'
],
self
::
SCENARIOS_SEARCH
=>
[
'status'
,
'coin'
,
'check_first_uid'
,
'check_second_uid'
,
'start_time'
,
'end_time'
,
'mobile'
],
self
::
SCENARIOS_SEARCH
=>
[
'status'
,
'coin'
,
'check_first_uid'
,
'check_second_uid'
,
'start_time'
,
'end_time'
,
'mobile'
],
];
}
public
function
rules
()
{
return
[
[[
'id'
,
'uid'
,
'check_first_status'
,
'check_first_uid'
,
'check_second_status'
,
'check_second_uid'
,
'status'
],
'integer'
],
[[
'mobile'
,
'coin'
,
'to_address'
,
'create_time'
,
'update_time'
,
'start_time'
,
'end_time'
],
'string'
,
'max'
=>
255
],
[
[
'id'
,
'uid'
,
'check_first_status'
,
'check_first_uid'
,
'check_second_status'
,
'check_second_uid'
,
'status'
],
'integer'
],
[
[
'mobile'
,
'coin'
,
'to_address'
,
'create_time'
,
'update_time'
,
'start_time'
,
'end_time'
],
'string'
,
'max'
=>
255
],
[[
'end_time'
],
'compare'
,
'compareAttribute'
=>
'start_time'
,
'operator'
=>
'>='
,
'skipOnEmpty'
=>
true
],
[[
'coin'
,
'start_time'
,
'end_time'
,
'mobile'
],
'default'
,
'value'
=>
''
,
'on'
=>
self
::
SCENARIOS_CHECK
],
[[
'status'
,
'coin'
,
'check_first_uid'
,
'check_second_uid'
,
'start_time'
,
'end_time'
,
'mobile'
],
'default'
,
'value'
=>
''
,
'on'
=>
self
::
SCENARIOS_SEARCH
],
[
[
'status'
,
'coin'
,
'check_first_uid'
,
'check_second_uid'
,
'start_time'
,
'end_time'
,
'mobile'
],
'default'
,
'value'
=>
''
,
'on'
=>
self
::
SCENARIOS_SEARCH
],
];
}
}
common/models/psources/CoinReleaseMember.php
View file @
fc15d2de
...
...
@@ -12,12 +12,14 @@ use Yii;
/**
* CoinReleaseMember
*
* @property int $id
* @property int $rule_id
* @property int $user_id
* @property int $amount 币种总数
* @property int $release 币种释放总数
* @property int $freeze 币种冻结总数
* @property int $output 币种提取总数
* @property int $platform_id 平台id
* @property string $mobile 手机号码
* @property string $coin 币种
...
...
@@ -76,9 +78,10 @@ class CoinReleaseMember extends BaseActiveRecord
/**
* 导入数据
* @param int $datas[0] mobile
* @param string $datas[1] coin
* @param int $datas[2] amount
*
* @param int $datas [0] mobile
* @param string $datas [1] coin
* @param int $datas [2] amount
* @return boolean
*/
public
static
function
implode
(
array
$datas
)
...
...
@@ -89,7 +92,8 @@ class CoinReleaseMember extends BaseActiveRecord
try
{
$result
=
self
::
getDb
()
->
createCommand
()
->
batchInsert
(
self
::
tableName
(),
[
'rule_id'
,
'mobile'
,
'coin'
,
'amount'
,
'release'
,
'freeze'
],
$datas
)
->
batchInsert
(
self
::
tableName
(),
[
'rule_id'
,
'mobile'
,
'coin'
,
'amount'
,
'release'
,
'freeze'
],
$datas
)
->
execute
();
return
$result
;
}
catch
(
\Exception
$e
)
{
...
...
common/service/chain33/Chain33Service.php
0 → 100644
View file @
fc15d2de
<?php
/**
* Created By Sublime Text 3
*
* @date 2018-09-18 10:28:23
* @authors rlgy <rlgyzhcn@qq.com>
*/
namespace
common\service\chain33
;
use
Yii
;
use
common\helpers\Curl
;
/**
* chain33 区块链接口
*/
class
Chain33Service
{
public
static
function
urlBuild
()
{
$config
=
Yii
::
$app
->
params
[
'chain33'
];
$scheme
=
$config
[
'scheme'
]
??
'http'
;
$host
=
$config
[
'host'
]
??
'127.0.0.1'
;
$port
=
(
string
)
$config
[
'port'
]
??
''
;
if
(
$port
)
{
return
$scheme
.
'://'
.
$host
.
':'
.
$port
;
}
else
{
return
$scheme
.
'://'
.
$host
;
}
}
public
static
function
jsonRpcBuild
(
$params
=
[],
$method
=
'Chain33.Query'
)
{
$data
=
[
'jsonrpc'
=>
'2.0'
,
'id'
=>
0
,
'method'
=>
$method
,
'params'
=>
[
$params
],
];
return
json_encode
(
$data
);
}
public
function
send
(
$params
=
[],
$method
=
'Chain33.Query'
)
{
$ch
=
new
Curl
();
$jsonrpc
=
self
::
jsonRpcBuild
(
$params
,
$method
);
echo
$jsonrpc
;
$ch
->
setHeader
(
'Content-Type'
,
'application/json'
);
$ch
->
setRawPostData
(
$jsonrpc
);
$result
=
$ch
->
post
(
self
::
urlBuild
(),
false
);
if
(
!
$result
)
{
return
[
'code'
=>
-
1
,
'msg'
=>
'请求失败'
];
}
if
(
0
==
$result
[
'id'
]
&&
empty
(
$result
[
'error'
]))
{
$result
[
'code'
]
=
$result
[
'id'
];
unset
(
$result
[
'id'
]);
return
$result
;
}
else
{
return
[
'code'
=>
-
1
,
'msg'
=>
$result
[
'error'
]];
}
}
/**
* 获取地址下的所有token资产
*
* @param string $address
* @param string $symbol
* @return array
*/
public
function
getAccountTokenAssets
(
$address
,
$symbol
)
{
$params
=
[
"execer"
=>
"token"
,
"funcName"
=>
"GetAccountTokenAssets"
,
"payload"
=>
[
"address"
=>
$address
,
"execer"
=>
"token"
,
],
];
return
$this
->
send
(
$params
);
}
/**
* 提币
*
* @param $from
* @param $to
* @param $amount
* @param string $note
* @param bool $isToken
* @param string $tokenSymbol
* @return array
*/
public
function
extractToken
(
$from
,
$to
,
$amount
,
$note
=
''
,
$isToken
=
true
,
$tokenSymbol
=
''
)
{
$params
=
[
"from"
=>
$from
,
"to"
=>
$to
,
"amount"
=>
-
$amount
,
"note"
=>
$note
,
"isToken"
=>
$isToken
?
true
:
false
,
"tokenSymbol"
=>
strtoupper
(
$tokenSymbol
)
];
return
$this
->
send
(
$params
,
'Chain33.SendToAddress'
);
}
/**
* token 转账
*
* @param $from
* @param $to
* @param $amount
* @param string $note
* @param bool $isToken
* @param string $tokenSymbol
* @return array
*/
public
function
transToken
(
$from
,
$to
,
$amount
,
$note
=
''
,
$isToken
=
true
,
$tokenSymbol
=
''
)
{
$params
=
[
"from"
=>
$from
,
"to"
=>
$to
,
"amount"
=>
$amount
,
"note"
=>
$note
,
"isToken"
=>
$isToken
?
true
:
false
,
"tokenSymbol"
=>
strtoupper
(
$tokenSymbol
)
];
return
$this
->
send
(
$params
,
'Chain33.SendToAddress'
);
}
}
console/controllers/DevController.php
View file @
fc15d2de
...
...
@@ -16,16 +16,19 @@ use yii\queue\Queue;
use
yii\console\Controller
;
use
common\models\psources\CoinPublishRule
;
use
common\models\psources\CoinReleaseMember
;
use
backend\jobs\ExtractTokenJob
;
/**
* Class ExchangeController
* 调用交易所api更新数据保存到redis
*
* @package console\controllers
*/
class
DevController
extends
Controller
{
/**
* 解冻币任务
*
* @return [type] [description]
*/
public
function
actionFreeze1
()
...
...
@@ -33,4 +36,10 @@ class DevController extends Controller
$qid
=
Yii
::
$app
->
queue
->
push
(
new
FreezeJob
([
'id'
=>
43
]));
var_dump
(
$qid
);
}
public
function
actionExtractToken
()
{
$id
=
Yii
::
$app
->
queue
->
push
(
new
ExtractTokenJob
([
'cid'
=>
1
]));
var_dump
(
$id
);
}
}
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