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
4354e87b
Commit
4354e87b
authored
Nov 19, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
fix
parents
c0f25112
333cff58
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
18 deletions
+96
-18
WalletController.php
api/controllers/WalletController.php
+1
-1
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+23
-15
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+2
-2
Dag.php
common/service/exchange/Dag.php
+68
-0
TickerController.php
console/controllers/TickerController.php
+2
-0
No files found.
api/controllers/WalletController.php
View file @
4354e87b
...
...
@@ -94,7 +94,7 @@ class WalletController extends BaseController
$execer
=
'coins'
;
$result
=
$service
->
getBalance
(
$address
,
$execer
);
if
(
0
!==
$result
[
'code'
])
{
$msg
=
$result
[
'msg'
]
;
$msg
=
'当前发币人数过多,请客官稍后再试'
;
$code
=
-
1
;
$data
=
null
;
goto
doEnd
;
...
...
common/business/ExchangeBusiness.php
View file @
4354e87b
...
...
@@ -33,20 +33,21 @@ class ExchangeBusiness
4
=>
'Bittrex'
,
5
=>
'Zb'
,
6
=>
'Token7'
,
7
=>
'S'
,
8
=>
'Zg'
,
9
=>
'Go'
,
10
=>
'Zhaobi'
,
11
=>
'Gdpro'
,
12
=>
'Ex'
,
13
=>
'Zt'
,
14
=>
'Tsc'
,
15
=>
'Binance'
,
16
=>
'Ceohk'
,
17
=>
'Biki'
,
18
=>
'Bilaxy'
,
19
=>
'Bitnasdaq'
,
20
=>
'Boc'
7
=>
'Zg'
,
8
=>
'Go'
,
9
=>
'Zhaobi'
,
10
=>
'Ex'
,
11
=>
'Zt'
,
12
=>
'Tsc'
,
13
=>
'Binance'
,
14
=>
'Biki'
,
15
=>
'Bilaxy'
,
16
=>
'Bitnasdaq'
,
17
=>
'Dag'
,
18
=>
'Boc'
,
//7 => 'S',//已挂
//11 => 'Gdpro',//已挂
//16 => 'Ceohk', //已挂
];
/**
...
...
@@ -99,7 +100,7 @@ class ExchangeBusiness
goto
doEnd
;
}
if
(
strtoupper
(
$tag
)
==
'GST'
||
strtoupper
(
$tag
)
==
'JNTK'
||
strtoupper
(
$tag
)
==
'SPT'
||
strtoupper
(
$tag
)
==
'STO'
||
strtoupper
(
$tag
)
==
'GM'
||
strtoupper
(
$tag
)
==
'BSTC'
||
strtoupper
(
$tag
)
==
'RYH'
||
strtoupper
(
$tag
)
==
'CNDT'
||
strtoupper
(
$tag
)
==
'WL'
||
strtoupper
(
$tag
)
==
'ETS'
||
strtoupper
(
$tag
)
==
'LIMS'
||
strtoupper
(
$tag
)
==
'AT'
||
strtoupper
(
$tag
)
==
'BTJ'
)
{
if
(
strtoupper
(
$tag
)
==
'GST'
||
strtoupper
(
$tag
)
==
'JNTK'
||
strtoupper
(
$tag
)
==
'SPT'
||
strtoupper
(
$tag
)
==
'STO'
||
strtoupper
(
$tag
)
==
'GM'
||
strtoupper
(
$tag
)
==
'BSTC'
||
strtoupper
(
$tag
)
==
'RYH'
||
strtoupper
(
$tag
)
==
'CNDT'
||
strtoupper
(
$tag
)
==
'WL'
||
strtoupper
(
$tag
)
==
'ETS'
||
strtoupper
(
$tag
)
==
'LIMS'
||
strtoupper
(
$tag
)
==
'AT'
||
strtoupper
(
$tag
)
==
'BTJ'
)
{
$quotation
=
[
'low'
=>
0
,
'high'
=>
0
,
...
...
@@ -122,6 +123,13 @@ class ExchangeBusiness
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'DAG'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Dag"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'USDT'
);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.2f"
,
$quotation
[
'last'
]);
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'GM'
,
'BSTC'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Token7"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'HA'
);
...
...
common/models/psources/CoinIssueCoin.php
View file @
4354e87b
...
...
@@ -130,8 +130,8 @@ class CoinIssueCoin extends CommonActiveRecord
}
$issue_record
=
CoinIssueCoin
::
find
()
->
where
([
'platform_id'
=>
$this
->
platform_id
,
'symbol'
=>
$this
->
symbol
,
'status'
=>
CoinIssueCoin
::
STATUS_SUCCESS
])
->
sum
(
'total'
);
$issue_record
=
empty
(
$issue_record
)
?
0
:
$issue_record
;
if
(
$issue_record
+
$this
->
$attribute
>
2
0
)
{
$this
->
addError
(
$attribute
,
'最大发行量
2
0亿,目前已发行'
.
$issue_record
.
'亿'
);
if
(
$issue_record
+
$this
->
$attribute
>
90
0
)
{
$this
->
addError
(
$attribute
,
'最大发行量
90
0亿,目前已发行'
.
$issue_record
.
'亿'
);
return
false
;
}
}
...
...
common/service/exchange/Dag.php
0 → 100644
View file @
4354e87b
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-8-7
* Time: 上午11:30
*/
namespace
common\service\exchange
;
use
linslin\yii2\curl\Curl
;
class
Dag
extends
Exchange
implements
ExchangeInterface
{
protected
$supported_symbol
=
'supported_symbol_dag'
;
protected
$quotation_prefix
=
'quotation_dag_'
;
protected
$base_url
=
'https://www.7xex.com/m/ticker/DAGUSDT'
;
public
function
symbolExists
(
$tag
=
'DAG'
,
$aim
=
"USDT"
)
{
$supported
=
$this
->
redis
->
smembers
(
$this
->
supported_symbol
);
if
(
is_array
(
$supported
)
&&
in_array
(
$this
->
formatSymbol
(
$tag
,
$aim
),
$supported
))
{
return
true
;
}
return
false
;
}
/**
* 转化交易对为请求变量
*
* @param string $tag
* @param string $aim
* @return mixed
*/
public
function
formatSymbol
(
$tag
=
'DAG'
,
$aim
=
'USDT'
)
{
return
strtoupper
(
$tag
.
$aim
);
}
/**
* 保存支持的交易对到redis数据库,使用crontab定时更新
*
* @return mixed|void
*/
public
function
setSupportedSymbol
()
{
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'DAGUSDT'
);
}
/**
* 更新交易对行情保存到redis,使用crontab定时更新
*
* @return mixed|void
*/
public
function
setQuotation
()
{
$curl
=
new
Curl
();
$content
=
$curl
->
get
(
$this
->
base_url
,
false
);
if
(
is_array
(
$content
))
{
$key
=
$this
->
quotation_prefix
.
'DAGUSDT'
;
$this
->
redis
->
hmset
(
$key
,
'low'
,
$content
[
'low'
],
'high'
,
$content
[
'high'
],
'last'
,
$content
[
'close'
],
'vol'
,
$content
[
'volume'
]);
$this
->
redis
->
sadd
(
$this
->
supported_symbol
,
'DAGUSDT'
);
}
}
}
\ No newline at end of file
console/controllers/TickerController.php
View file @
4354e87b
...
...
@@ -22,6 +22,8 @@ class TickerController extends Controller
$ticker_builder
->
TickerSort
();
});
}
echo
date
(
'Y-m-d H:i:s'
)
.
'排序更新成功'
.
PHP_EOL
;
return
0
;
}
public
function
actionHot
()
...
...
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