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
bef37105
Commit
bef37105
authored
Jul 05, 2018
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钱包用户
parent
dd205671
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
143 additions
and
0 deletions
+143
-0
MemberController.php
backend/controllers/MemberController.php
+22
-0
wallet.php
backend/views/member/wallet.php
+74
-0
MemberAsset.php
common/models/pwallet/MemberAsset.php
+47
-0
No files found.
backend/controllers/MemberController.php
View file @
bef37105
...
...
@@ -10,6 +10,7 @@ namespace backend\controllers;
use
Yii
;
use
common\models\pwallet\Member
;
use
common\models\pwallet\MemberAsset
;
class
MemberController
extends
BaseController
{
...
...
@@ -99,4 +100,24 @@ class MemberController extends BaseController
}
$this
->
error
(
'用户不存在'
,
'/admin/member/index'
);
}
public
function
actionWallet
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
$request
=
Yii
::
$app
->
request
;
$page
=
$request
->
get
(
'page'
,
1
);
$limit
=
$request
->
get
(
'limit'
,
10
);
$uid
=
$request
->
get
(
'uid'
,
''
);
$where
=
[];
if
(
$uid
)
{
$where
[]
=
[
'uid'
=>
$uid
];
}
$data
=
MemberAsset
::
getList
(
$page
,
$limit
,
$where
);
Yii
::
$app
->
response
->
format
=
'json'
;
Yii
::
$app
->
response
->
data
=
$data
;
Yii
::
$app
->
response
->
send
();
}
return
$this
->
render
(
'wallet'
);
}
}
\ No newline at end of file
backend/views/member/wallet.php
0 → 100644
View file @
bef37105
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-7-5
* Time: 上午9:57
*/
?>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md8"
>
<form
class=
"layui-form"
>
<div
class=
"layui-inline"
>
<input
class=
"layui-input"
placeholder=
"UID"
name=
"uid"
>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"submit1"
>
筛选
</button>
</div>
</form>
</div>
</div>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md8"
>
<table
id=
"table1"
lay-filter=
"table1"
></table>
</div>
</div>
<script>
var
table
=
layui
.
table
;
var
form
=
layui
.
form
;
table
.
render
({
elem
:
'#table1'
,
url
:
'/admin/member/wallet'
,
page
:
1
,
cols
:
[[
{
field
:
'uid'
,
title
:
'UID'
},
{
field
:
'public_key'
,
title
:
'钱包公钥'
},
{
title
:
'操作'
,
toolbar
:
'#tools'
,
fixed
:
'right'
}
]],
});
table
.
on
(
'tool(table1)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
var
event
=
obj
.
event
;
if
(
event
==
'view_assets'
)
{
var
assets
=
JSON
.
parse
(
data
.
asset
);
//TODO 资产显示
var
content
=
'<table class="layui-table" style="margin: 5px; width: 340px">'
;
content
+=
'<tr><td>币种</td><td>数量</td></tr>'
;
$
.
each
(
assets
,
function
(
key
,
val
)
{
content
+=
'<tr><td>'
+
key
+
'</td>'
+
'<td>'
+
val
+
'</td></tr>'
;
});
content
+=
'</table>'
;
var
index
=
layer
.
open
({
type
:
1
,
content
:
content
,
title
:
'用户(UID:'
+
data
.
uid
+
')资产'
,
area
:
'350px'
,
resize
:
false
,
});
}
});
//表单提交
form
.
on
(
'submit(submit1)'
,
function
(
data
)
{
table
.
reload
(
'table1'
,
{
where
:
data
.
field
,
page
:
{
curr
:
1
},
});
return
false
;
});
</script>
<script
type=
"text/html"
id=
"tools"
>
<
a
class
=
"layui-btn layui-btn-sm"
lay
-
event
=
"view_assets"
>
查看资产
<
/a
>
</script>
common/models/pwallet/MemberAsset.php
0 → 100644
View file @
bef37105
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-7-5
* Time: 上午10:27
*/
namespace
common\models\pwallet
;
use
common\core\BaseActiveRecord
;
/**
* Class MemberAsset
* 用户资产表
*
* @property integer $id
* @property integer $uid
* @property string $asset
* @property string $create_at
* @property string $update_at
* @package common\models\pwallet
*/
class
MemberAsset
extends
BaseActiveRecord
{
public
static
function
getDb
()
{
return
\Yii
::
$app
->
get
(
'db_pwallet'
);
}
public
function
formName
()
{
return
''
;
}
public
function
attributeLabels
()
{
return
[
'id'
=>
'ID'
,
'uid'
=>
'用户ID'
,
'asset'
=>
'资产信息'
,
'create_at'
=>
'创建时间'
,
'update_at'
=>
'更新时间'
];
}
}
\ 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