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
0b89476d
Commit
0b89476d
authored
Jun 15, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台(不要写死)
parent
d4506c9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
CoinController.php
backend/controllers/CoinController.php
+2
-1
index.php
backend/views/coin/index.php
+3
-1
Coin.php
common/models/pwallet/Coin.php
+13
-0
No files found.
backend/controllers/CoinController.php
View file @
0b89476d
...
...
@@ -48,7 +48,8 @@ class CoinController extends BaseController
Yii
::
$app
->
response
->
format
=
'json'
;
return
$data
;
}
return
$this
->
render
(
'index'
);
$platforms
=
Coin
::
getPlatformList
();
return
$this
->
render
(
'index'
,
[
'platforms'
=>
$platforms
]);
}
public
function
actionAdd
()
...
...
backend/views/coin/index.php
View file @
0b89476d
...
...
@@ -32,7 +32,9 @@
<div
class=
"layui-input-inline"
>
<select
name=
"platform"
>
<option
value=
"all"
>
全部
</option>
<option
value=
"ethereum"
>
eth
</option>
<?php
foreach
(
$platforms
as
$platform
)
:
?>
<option
value=
"
<?=
$platform
?>
"
>
<?=
$platform
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
...
...
common/models/pwallet/Coin.php
View file @
0b89476d
...
...
@@ -98,4 +98,16 @@ class Coin extends BaseActiveRecord
{
return
$this
->
hasOne
(
MinerFee
::
className
(),
[
'platform'
=>
'platform'
]);
}
/**
* 获取平台列表
*
* @return array
*/
public
static
function
getPlatformList
()
{
$data
=
self
::
find
()
->
select
(
'platform'
)
->
asArray
()
->
all
();
$data
=
array_unique
(
array_column
(
$data
,
'platform'
));
return
$data
;
}
}
\ 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