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
5526dced
Commit
5526dced
authored
Mar 25, 2020
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
parents
9682acd2
2b8fd3a5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
18 deletions
+8
-18
WalletCoinController.php
api/controllers/WalletCoinController.php
+8
-18
No files found.
api/controllers/WalletCoinController.php
View file @
5526dced
...
@@ -41,17 +41,11 @@ class WalletCoinController extends BaseController
...
@@ -41,17 +41,11 @@ class WalletCoinController extends BaseController
}
}
$this
->
data
=
[];
$this
->
data
=
[];
$relation_model
=
WalletCoinRelation
::
find
()
->
select
(
'coin_id'
)
->
where
([
'platform_id'
=>
(
int
)
$platform_id
])
->
asArray
()
->
all
();
if
(
empty
(
$relation_model
))
{
goto
doEnd
;
}
$relation_ids
=
array_column
(
$relation_model
,
'coin_id'
);
foreach
(
$condition
as
$val
)
{
foreach
(
$condition
as
$val
)
{
if
(
is_array
(
$val
))
{
if
(
is_array
(
$val
))
{
$model
=
WalletCoin
::
find
()
->
select
(
'id,icon,name,nickname,introduce,platform,chain,address as contract_address,treaty'
)
$model
=
WalletCoin
::
find
()
->
select
(
'id,icon,name,nickname,introduce,platform,chain,address as contract_address,treaty'
)
->
where
([
'name'
=>
$val
[
0
],
'platform'
=>
$val
[
1
]])
->
where
([
'name'
=>
$val
[
0
],
'platform'
=>
$val
[
1
]])
->
andWhere
([
'
in'
,
'id'
,
$relation_ids
])
->
andWhere
([
'
>'
,
"find_in_set(
$platform_id
, platform_id)"
,
0
])
->
asArray
()
->
asArray
()
->
one
();
->
one
();
}
}
...
@@ -59,7 +53,7 @@ class WalletCoinController extends BaseController
...
@@ -59,7 +53,7 @@ class WalletCoinController extends BaseController
if
(
is_string
(
$val
))
{
if
(
is_string
(
$val
))
{
$model
=
WalletCoin
::
find
()
->
select
(
'id,icon,name,nickname,introduce,platform,chain,address as contract_address,treaty'
)
$model
=
WalletCoin
::
find
()
->
select
(
'id,icon,name,nickname,introduce,platform,chain,address as contract_address,treaty'
)
->
where
([
'name'
=>
$val
])
->
where
([
'name'
=>
$val
])
->
andWhere
([
'
in'
,
'id'
,
$relation_ids
])
->
andWhere
([
'
>'
,
"find_in_set(
$platform_id
, platform_id)"
,
0
])
->
asArray
()
->
asArray
()
->
one
();
->
one
();
}
}
...
@@ -129,15 +123,9 @@ class WalletCoinController extends BaseController
...
@@ -129,15 +123,9 @@ class WalletCoinController extends BaseController
$page
=
empty
(
$params
[
'page'
])
?
1
:
$params
[
'page'
];
$page
=
empty
(
$params
[
'page'
])
?
1
:
$params
[
'page'
];
$limit
=
empty
(
$params
[
'limit'
])
?
10
:
$params
[
'limit'
];
$limit
=
empty
(
$params
[
'limit'
])
?
10
:
$params
[
'limit'
];
$relation_model
=
WalletCoinRelation
::
find
()
->
select
(
'coin_id'
)
->
where
([
'platform_id'
=>
(
int
)
$platform_id
])
->
asArray
()
->
all
();
if
(
empty
(
$relation_model
))
{
goto
doEnd
;
}
$relation_ids
=
array_column
(
$relation_model
,
'coin_id'
);
$query
=
WalletCoin
::
find
()
$query
=
WalletCoin
::
find
()
->
select
(
'id, icon, name, nickname, platform, chain, address as contract_address, treaty'
)
->
select
(
'id, icon, name, nickname, platform, chain, address as contract_address, treaty'
)
->
where
([
'
in'
,
'id'
,
$relation_ids
])
->
where
([
'
>'
,
"find_in_set(
$platform_id
, platform_id)"
,
0
])
->
orderBy
(
'id'
);
->
orderBy
(
'id'
);
if
(
false
!=
$chain
)
{
if
(
false
!=
$chain
)
{
...
@@ -187,12 +175,14 @@ class WalletCoinController extends BaseController
...
@@ -187,12 +175,14 @@ class WalletCoinController extends BaseController
$this
->
msg
=
'参数错误'
;
$this
->
msg
=
'参数错误'
;
goto
doEnd
;
goto
doEnd
;
}
}
$relation
=
WalletCoinRelation
::
find
()
->
where
([
'coin_id'
=>
$id
,
'platform_id'
=>
(
int
)
$platform_id
])
->
one
();
$this
->
data
=
WalletCoin
::
find
()
if
(
empty
(
$relation
))
{
->
where
([
'id'
=>
$id
])
->
andWhere
([
'>'
,
"find_in_set(
$platform_id
, platform_id)"
,
0
])
->
one
();
if
(
empty
(
$this
->
data
))
{
goto
doEnd
;
goto
doEnd
;
}
}
$this
->
data
=
$relation
->
coin
;
$quotation
=
ExchangeBusiness
::
getquatation
(
$this
->
data
->
name
);
$quotation
=
ExchangeBusiness
::
getquatation
(
$this
->
data
->
name
);
$tikerdata
=
[
$tikerdata
=
[
'publish_count'
=>
$this
->
data
->
publish_count
,
'publish_count'
=>
$this
->
data
->
publish_count
,
...
...
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