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
7e653cc9
Commit
7e653cc9
authored
Aug 08, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过地址查看设备唯一码
parent
9a329d34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
181 additions
and
0 deletions
+181
-0
IndexAsset.php
backend/assets/platformCoins/IndexAsset.php
+25
-0
PlatformCoinsController.php
backend/controllers/PlatformCoinsController.php
+46
-0
index.php
backend/views/platform-coins/index.php
+45
-0
index.js
backend/web/js/platform-coins/index.js
+65
-0
No files found.
backend/assets/platformCoins/IndexAsset.php
0 → 100644
View file @
7e653cc9
<?php
/**
* Created By Sublime Text 3
*
* @authors rlgy <rlgyzhcn@qq.com>
* @date 2018-09-07 17:41:04
*/
namespace
backend\assets\platformCoins
;
use
yii\web\AssetBundle
;
use
yii\web\View
;
class
IndexAsset
extends
AssetBundle
{
public
$sourcePath
=
'@backend/web/js/platform-coins'
;
public
$js
=
[
'index.js'
,
];
public
$jsOptions
=
[
'position'
=>
View
::
POS_END
,
];
}
\ No newline at end of file
backend/controllers/PlatformCoinsController.php
0 → 100644
View file @
7e653cc9
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 2018/12/17
* Time: 10:13
*/
namespace
backend\controllers
;
use
backend\models\coin\CoinPlatformForm
;
use
common\models\psources\CoinPlatform
;
use
common\models\psources\CoinPlatformCoins
;
use
Yii
;
class
PlatformCoinsController
extends
BaseController
{
public
function
actionList
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$page
=
$request
->
get
(
'page'
,
1
);
$limit
=
$request
->
get
(
'limit'
,
10
);
$coins_address
=
$request
->
get
(
'coins_address'
,
'**'
);
$where
=
[];
if
(
$coins_address
)
{
$where
[]
=
[
'coins_address'
=>
$coins_address
];
}
$data
=
CoinPlatformCoins
::
getList
(
$page
,
$limit
,
$where
);
foreach
(
$data
[
'data'
]
as
&
$val
){
unset
(
$val
[
'id'
]);
unset
(
$val
[
'coins_name'
]);
unset
(
$val
[
'type'
]);
unset
(
$val
[
'platform_id'
]);
unset
(
$val
[
'update_time'
]);
}
$data
[
'code'
]
=
0
;
Yii
::
$app
->
response
->
format
=
'json'
;
return
$data
;
}
return
$this
->
render
(
'index'
);
}
}
\ No newline at end of file
backend/views/platform-coins/index.php
0 → 100644
View file @
7e653cc9
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-5-31
* Time: 上午9:59
*/
use
backend\assets\platformCoins\IndexAsset
;
IndexAsset
::
register
(
$this
);
?>
<style>
.layui-table-tips-c
{
padding
:
0px
;
}
</style>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md8"
>
<form
class=
"layui-form"
method=
"get"
action=
""
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
style=
"margin-bottom: 0; width: 100px;"
>
按地址搜索
</label>
<div
class=
"layui-input-inline"
>
<input
class=
"layui-input"
name=
"coins_address"
style=
"width: 400px;"
>
</div>
</div>
<div
class=
"layui-inline"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"form1"
>
搜索
</button>
</div>
</form>
</div>
</div>
<div
class=
"layui-row"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
</div>
<script
type=
"text/html"
id=
"operationTpl"
>
<
a
lay
-
event
=
"edit"
>
<
button
class
=
"layui-btn layui-btn-sm"
><
i
class
=
"layui-icon"
>&
#
xe642
;
<
/i></
button
>
<
/a
>
<
a
lay
-
event
=
"delete"
>
<
button
class
=
"layui-btn layui-btn-sm layui-btn-danger"
><
i
class
=
"layui-icon"
>&
#
xe640
;
<
/i></
button
>
<
/a
>
</script>
backend/web/js/platform-coins/index.js
0 → 100644
View file @
7e653cc9
/**
* @author rlgyzhcn@qq.com
*/
var
table
=
layui
.
table
;
var
form
=
layui
.
form
;
var
layer
=
layui
.
layer
;
form
.
render
();
var
tableIns
=
table
.
render
({
elem
:
"#table1"
,
url
:
'/admin/platform-coins/list'
,
limit
:
10
,
page
:
1
,
loading
:
true
,
cols
:
[[
{
field
:
'coins_address'
,
title
:
'地址'
},
{
field
:
'deviceCode'
,
title
:
'设备唯一码'
},
{
field
:
'create_time'
,
title
:
'添加时间'
},
]],
});
form
.
on
(
'submit(form1)'
,
function
(
data
)
{
table
.
reload
(
"table1"
,
{
where
:
data
.
field
,
page
:
{
curr
:
1
},
});
return
false
;
});
//监听单元格事件
table
.
on
(
'tool(table1)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
==
'delete'
)
{
layer
.
confirm
(
'真的要删除'
+
data
.
name
+
'吗?'
,
{
icon
:
3
,
title
:
'删除'
},
function
(
index
)
{
layer
.
close
(
index
);
//向服务端发送删除指令
$
.
get
(
'/admin/wallet/delete?id='
+
obj
.
data
.
id
,
function
(
data
,
status
)
{
if
(
data
.
code
==
0
)
{
obj
.
del
();
//删除对应行(tr)的DOM结构
}
layer
.
msg
(
data
.
msg
);
});
});
}
else
if
(
obj
.
event
==
'edit'
)
{
$
.
get
(
'/admin/wallet/edit'
,
{
id
:
data
.
id
},
function
(
str
)
{
var
editIndex
=
layer
.
open
({
type
:
1
,
title
:
'编辑: '
+
data
.
name
,
area
:
'625px'
,
content
:
str
,
btn
:
[
'保存'
,
'取消'
],
btn1
:
function
()
{
// console.log();
$
.
post
(
'/admin/wallet/edit'
,
$
(
"#walletEdit"
).
serialize
(),
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
rev
.
code
==
0
)
{
table
.
reload
(
"table1"
,
{
where
:
data
.
field
,
});
layer
.
close
(
editIndex
);
}
});
}
});
});
}
});
\ 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