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
2e16fe95
Commit
2e16fe95
authored
Nov 25, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/issue_coin
parents
fc7cfdda
2a67a230
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
ExploreController.php
api/controllers/ExploreController.php
+5
-5
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+8
-1
No files found.
api/controllers/ExploreController.php
View file @
2e16fe95
...
@@ -30,7 +30,7 @@ class ExploreController extends BaseController
...
@@ -30,7 +30,7 @@ class ExploreController extends BaseController
}
}
foreach
(
$app_category_model
as
$key
=>
$val
)
{
foreach
(
$app_category_model
as
$key
=>
$val
)
{
unset
(
$val
->
apps
);
unset
(
$val
->
apps
);
$val
->
name
=
$val
->
name
[
$this
->
lang
]
;
$val
->
name
=
isset
(
$val
->
name
[
$this
->
lang
])
?
$val
->
name
[
$this
->
lang
]
:
''
;
$apps_model
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, type, app_url, slogan'
)
$apps_model
=
ExploreApp
::
find
()
->
select
(
'id, name, icon, type, app_url, slogan'
)
->
where
([
'app_category_id'
=>
(
int
)
$val
->
id
,
'status'
=>
ExploreApp
::
STATUS_ON
])
->
where
([
'app_category_id'
=>
(
int
)
$val
->
id
,
'status'
=>
ExploreApp
::
STATUS_ON
])
->
orderBy
(
'sort'
)
->
orderBy
(
'sort'
)
...
@@ -41,7 +41,7 @@ class ExploreController extends BaseController
...
@@ -41,7 +41,7 @@ class ExploreController extends BaseController
continue
;
continue
;
}
}
foreach
(
$apps_model
as
&
$app
)
{
foreach
(
$apps_model
as
&
$app
)
{
$app
->
name
=
$app
->
name
[
$this
->
lang
]
;
$app
->
name
=
isset
(
$app
->
name
[
$this
->
lang
])
?
$app
->
name
[
$this
->
lang
]
:
''
;
}
}
$val
->
apps
=
$apps_model
;
$val
->
apps
=
$apps_model
;
unset
(
$val
->
sort
);
unset
(
$val
->
sort
);
...
@@ -79,9 +79,9 @@ class ExploreController extends BaseController
...
@@ -79,9 +79,9 @@ class ExploreController extends BaseController
}
}
foreach
(
$app_category_model
as
&
$val
)
{
foreach
(
$app_category_model
as
&
$val
)
{
foreach
(
$val
->
applications
as
$app
)
{
foreach
(
$val
->
applications
as
$app
)
{
$app
->
name
=
$app
->
name
[
$this
->
lang
]
;
$app
->
name
=
isset
(
$app
->
name
[
$this
->
lang
])
?
$app
->
name
[
$this
->
lang
]
:
''
;
}
}
$val
->
name
=
$val
->
name
[
$this
->
lang
]
;
$val
->
name
=
isset
(
$val
->
name
[
$this
->
lang
])
?
$val
->
name
[
$this
->
lang
]
:
''
;
$val
->
apps
=
$val
->
applications
;
$val
->
apps
=
$val
->
applications
;
unset
(
$val
->
id
);
unset
(
$val
->
id
);
unset
(
$val
->
sort
);
unset
(
$val
->
sort
);
...
@@ -124,7 +124,7 @@ class ExploreController extends BaseController
...
@@ -124,7 +124,7 @@ class ExploreController extends BaseController
goto
doEnd
;
goto
doEnd
;
}
}
foreach
(
$apps_model
as
&
$app
)
{
foreach
(
$apps_model
as
&
$app
)
{
$app
->
name
=
$app
->
name
[
$this
->
lang
]
;
$app
->
name
=
isset
(
$app
->
name
[
$this
->
lang
])
?
$app
->
name
[
$this
->
lang
]
:
''
;
}
}
$data
=
$apps_model
;
$data
=
$apps_model
;
$msg
=
'success'
;
$msg
=
'success'
;
...
...
common/business/ExchangeBusiness.php
View file @
2e16fe95
...
@@ -130,6 +130,13 @@ class ExchangeBusiness
...
@@ -130,6 +130,13 @@ class ExchangeBusiness
goto
doEnd
;
goto
doEnd
;
}
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'BNC'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Bitnasdaq"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'USDT'
);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.2f"
,
$quotation
[
'last'
]);
goto
doEnd
;
}
if
(
in_array
(
strtoupper
(
$tag
),
[
'GM'
,
'BSTC'
]))
{
if
(
in_array
(
strtoupper
(
$tag
),
[
'GM'
,
'BSTC'
]))
{
$exchange
=
ExchangeFactory
::
createExchange
(
"Token7"
);
$exchange
=
ExchangeFactory
::
createExchange
(
"Token7"
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'HA'
);
$quotation
=
$exchange
->
getTicker
(
$tag
,
'HA'
);
...
@@ -289,7 +296,7 @@ class ExchangeBusiness
...
@@ -289,7 +296,7 @@ class ExchangeBusiness
$exchange
=
ExchangeFactory
::
createExchange
(
"Go"
);
$exchange
=
ExchangeFactory
::
createExchange
(
"Go"
);
$rate
=
$exchange
->
getTicker
(
"CNY"
,
"USD"
);
$rate
=
$exchange
->
getTicker
(
"CNY"
,
"USD"
);
$cny_usd_rate
=
1
/
$rate
[
'last'
];
$cny_usd_rate
=
1
/
$rate
[
'last'
];
if
(
in_array
(
strtoupper
(
$tag
),
[
'FOLI'
,
'CIC'
,
'KPC8'
,
'BVA'
]))
{
if
(
in_array
(
strtoupper
(
$tag
),
[
'FOLI'
,
'CIC'
,
'KPC8'
,
'BVA'
,
'DAG'
,
'BNC'
]))
{
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
$quotation
[
'usd'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
$quotation
[
'rmb'
]
=
(
float
)
sprintf
(
"%0.4f"
,
$quotation
[
'last'
]
/
$cny_usd_rate
);
}
else
if
(
in_array
(
strtoupper
(
$tag
),
[
'SUSD'
]))
{
}
else
if
(
in_array
(
strtoupper
(
$tag
),
[
'SUSD'
]))
{
...
...
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