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
29b3919f
Commit
29b3919f
authored
Jun 03, 2021
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行情自定义
parent
7d042a5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+12
-0
WalletCoinTicker.php
common/models/psources/WalletCoinTicker.php
+21
-0
No files found.
common/business/ExchangeBusiness.php
View file @
29b3919f
...
...
@@ -9,6 +9,7 @@
namespace
common\business
;
use
common\models\psources\Coin
;
use
common\models\psources\WalletCoinTicker
;
use
common\service\coin\CoinFactory
;
use
common\service\exchange\ExchangeFactory
;
use
Yii
;
...
...
@@ -71,6 +72,17 @@ class ExchangeBusiness
*/
public
static
function
getquatation
(
$tag
=
'btc'
)
{
$coinTicker
=
WalletCoinTicker
::
find
()
->
where
([
'coin_name'
=>
$tag
])
->
asArray
()
->
one
();
if
(
!
empty
(
$coinTicker
))
{
$quotation
=
[
'low'
=>
$coinTicker
[
'ticker'
],
'high'
=>
$coinTicker
[
'ticker'
],
'last'
=>
$coinTicker
[
'ticker'
],
'rmb'
=>
$coinTicker
[
'ticker'
],
];
goto
doEnd
;
}
$coin_quotation_disable_items
=
Yii
::
$app
->
params
[
'coin_quotation_disable_items'
];
if
(
strtoupper
(
$tag
)
==
'CCNY'
||
strtoupper
(
$tag
)
==
'CNYT'
||
strtoupper
(
$tag
)
==
'ETC'
||
strtoupper
(
$tag
)
==
'YX'
)
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Zhaobi"
);
...
...
common/models/psources/WalletCoinTicker.php
0 → 100644
View file @
29b3919f
<?php
namespace
common\models\psources
;
use
Yii
;
use
common\core\BaseActiveRecord
;
class
WalletCoinTicker
extends
BaseActiveRecord
{
public
static
function
getDb
()
{
return
Yii
::
$app
->
get
(
'p_sources'
);
}
public
static
function
tableName
()
{
return
'{{wallet_coin_ticker}}'
;
}
}
\ 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