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
04404eee
Commit
04404eee
authored
Oct 22, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
3030c9c5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
101 deletions
+53
-101
CoinSupportedSymbolController.php
backend/controllers/CoinSupportedSymbolController.php
+9
-8
add.php
backend/views/coin-supported-symbol/add.php
+7
-19
edit.php
backend/views/coin-supported-symbol/edit.php
+0
-65
index.php
backend/views/coin-supported-symbol/index.php
+3
-5
index.php
backend/views/wallet/index.php
+1
-0
index.js
backend/web/js/coin-supported-symbol/index.js
+33
-4
No files found.
backend/controllers/CoinSupportedSymbolController.php
View file @
04404eee
...
...
@@ -11,7 +11,7 @@ class CoinSupportedSymbolController extends BaseController
{
public
function
actionList
()
{
$platform_
withhold_
id
=
Yii
::
$app
->
request
->
get
(
'id'
);
$platform_id
=
Yii
::
$app
->
request
->
get
(
'id'
);
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
...
...
@@ -20,7 +20,7 @@ class CoinSupportedSymbolController extends BaseController
$id
=
$request
->
get
(
'id'
,
''
);
$where
=
[];
if
(
$id
)
{
$where
[]
=
[
'platform_
withhold_
id'
=>
$id
];
$where
[]
=
[
'platform_id'
=>
$id
];
}
$data
=
CoinSupportedSymbol
::
getList
(
$page
,
$limit
,
$where
);
$data
[
'code'
]
=
0
;
...
...
@@ -28,7 +28,7 @@ class CoinSupportedSymbolController extends BaseController
return
$data
;
}
return
$this
->
render
(
'index'
,
[
'platform_
withhold_id'
=>
$platform_withhold
_id
]);
return
$this
->
render
(
'index'
,
[
'platform_
id'
=>
$platform
_id
]);
}
public
function
actionAdd
()
...
...
@@ -40,11 +40,12 @@ class CoinSupportedSymbolController extends BaseController
if
(
$model
->
load
(
$data
,
''
)
&&
$model
->
validate
())
{
$coinSupportedSymbol
=
new
CoinSupportedSymbol
();
$coinSupportedSymbol
->
platform_withhold_id
=
$data
[
'platform_withhold_id'
];
$coinSupportedSymbol
->
symbol
=
$data
[
'symbol'
];
$coinSupportedSymbol
->
platform_id
=
$data
[
'platform_id'
];
$coinSupportedSymbol
->
currency
=
$data
[
'currency'
];
$coinSupportedSymbol
->
base_currency
=
$data
[
'base_currency'
];
$result
=
$coinSupportedSymbol
->
save
();
if
(
$result
===
true
)
{
$this
->
success
(
'添加成功'
,
'/admin/coin-supported-symbol/list?id='
.
$data
[
'platform_
withhold_
id'
]);
$this
->
success
(
'添加成功'
,
'/admin/coin-supported-symbol/list?id='
.
$data
[
'platform_id'
]);
}
}
//表单验证失败
...
...
@@ -59,8 +60,8 @@ class CoinSupportedSymbolController extends BaseController
}
$this
->
error
(
$errors
,
Yii
::
$app
->
request
->
getReferrer
());
}
$platform_
withhold_id
=
Yii
::
$app
->
request
->
get
(
'platform_withhold
_id'
);
return
$this
->
render
(
'add'
,
[
'model'
=>
$model
,
'platform_
withhold_id'
=>
$platform_withhold
_id
]);
$platform_
id
=
Yii
::
$app
->
request
->
get
(
'platform
_id'
);
return
$this
->
render
(
'add'
,
[
'model'
=>
$model
,
'platform_
id'
=>
$platform
_id
]);
}
public
function
actionDelete
()
...
...
backend/views/coin-supported-symbol/add.php
View file @
04404eee
<h4>
添加货币对
</h4>
<style>
.layui-form-label
{
width
:
100px
;
}
</style>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-col-md6"
>
<form
class=
"layui-form"
method=
"post"
action=
""
>
<div
style=
"padding: 5px 20px;"
>
<br>
<form
id=
"addData"
>
<input
name=
"_csrf"
type=
"hidden"
value=
"
<?=
Yii
::
$app
->
request
->
getCsrfToken
()
?>
"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
货币对
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"symbol"
lay-verify=
"required"
>
<div
class=
"input-group my-group"
>
<span
class=
"input-group-addon"
>
币种名称
</span>
<input
name=
"coin_name"
type=
"text"
class=
"form-control"
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<button
class=
"layui-btn"
>
提交
</button>
</div>
<input
class=
"layui-input"
name=
"platform_withhold_id"
type=
"hidden"
value=
"
<?=
$platform_withhold_id
?>
"
<input
class=
"layui-input"
name=
"platform_id"
type=
"hidden"
value=
"
<?=
$platform_id
?>
"
lay-verify=
"required"
>
</form>
</div>
</div>
backend/views/coin-supported-symbol/edit.php
deleted
100644 → 0
View file @
3030c9c5
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-5-31
* Time: 下午6:23
*/
?>
<style>
.layui-form-label
{
width
:
100px
;
}
</style>
<div
class=
"layui-row"
style=
"padding: 5px;"
>
<div
class=
"layui-col-md12"
>
<form
class=
"layui-form"
method=
"post"
action=
""
id=
"walletEdit"
>
<input
name=
"_csrf"
type=
"hidden"
value=
"
<?=
Yii
::
$app
->
request
->
getCsrfToken
()
?>
"
>
<input
name=
"id"
type=
"hidden"
value=
"
<?=
$model
->
id
?>
"
>
<div
class=
"layui-inline"
>
<label
class=
"layui-form-label"
>
简称
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"name"
value=
"
<?=
$model
->
name
?>
"
lay-verify=
"required"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
下载地址
</label>
<div
class=
"layui-input-block"
>
<input
class=
"layui-input"
name=
"download_url"
value=
"
<?=
$model
->
download_url
?>
"
>
</div>
</div>
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
介绍
</label>
<div
class=
"layui-input-block"
>
<textarea
class=
"layui-textarea"
name=
"introduce"
>
<?=
$model
->
introduce
?>
</textarea>
</div>
</div>
</form>
</div>
</div>
<script>
var
laydate
=
layui
.
laydate
;
laydate
.
render
({
elem
:
"#time1"
});
//图片上传
var
uploader
=
layui
.
upload
;
$_csrf
=
$
(
"input[name='_csrf']"
).
val
();
uploader
.
render
({
elem
:
"#upload1"
,
url
:
'/admin/coin/upload'
,
data
:
{
_csrf
:
$_csrf
},
done
:
function
(
res
)
{
console
.
log
(
res
.
data
.
src
);
$
(
"input[name='icon']"
).
val
(
res
.
data
.
src
);
$
(
"#icon1"
).
attr
(
'src'
,
res
.
data
.
src
);
},
error
:
function
(
res
)
{
}
});
//form render
var
form
=
layui
.
form
;
form
.
render
();
</script>
backend/views/coin-supported-symbol/index.php
View file @
04404eee
...
...
@@ -16,15 +16,13 @@ IndexAsset::register($this);
padding
:
0px
;
}
</style>
<h4>
货币
对
列表
</h4>
<h4>
货币列表
</h4>
<div
class=
"layui-row"
>
<div
class=
"layui-col-md1"
>
<a
href=
"/admin/coin-supported-symbol/add?platform_withhold_id=
<?=
$platform_withhold_id
?>
"
"
>
<button
class=
"layui-btn layui-btn-default"
id=
"add"
>
添加货币对
</button>
</a>
<button
class=
"layui-btn layui-btn-sm"
lay-event=
"add"
id=
"add"
>
单笔添加
</button>
</div>
</div>
<input
id=
"platform_
withhold_id"
type=
"hidden"
value=
"
<?=
$platform_withhold
_id
?>
"
>
<input
id=
"platform_
id"
type=
"hidden"
value=
"
<?=
$platform
_id
?>
"
>
<div
class=
"layui-row"
>
<table
class=
"layui-table"
id=
"table1"
lay-filter=
"table1"
></table>
</div>
...
...
backend/views/wallet/index.php
View file @
04404eee
...
...
@@ -48,4 +48,5 @@ IndexAsset::register($this);
<
a
lay
-
event
=
"delete"
>
<
button
class
=
"layui-btn layui-btn-sm layui-btn-danger"
><
i
class
=
"layui-icon"
>&
#
xe640
;
<
/i></
button
>
<
/a
>
<
a
class
=
"layui-btn layui-btn-primary layui-btn-xs"
href
=
"/admin/coin-supported-symbol/list?id={{d.id}}"
>
支持发行货币对
<
/a
>
</script>
backend/web/js/coin-supported-symbol/index.js
View file @
04404eee
...
...
@@ -5,16 +5,17 @@ var table = layui.table;
var
form
=
layui
.
form
;
var
layer
=
layui
.
layer
;
form
.
render
();
var
platform_
withhold_id
=
$
(
"#platform_withhold
_id"
).
val
();
var
platform_
id
=
$
(
"#platform
_id"
).
val
();
var
tableIns
=
table
.
render
({
elem
:
"#table1"
,
url
:
'/admin/coin-supported-symbol/list?id='
+
platform_
withhold_
id
,
url
:
'/admin/coin-supported-symbol/list?id='
+
platform_id
,
limit
:
10
,
page
:
1
,
loading
:
true
,
cols
:
[[
{
field
:
'id'
,
title
:
'ID'
},
{
field
:
'symbol'
,
title
:
'货币对'
},
{
field
:
'currency'
,
title
:
'交易货币'
},
{
field
:
'base_currency'
,
title
:
'基础货币'
},
{
field
:
'create_time'
,
title
:
'创建时间'
},
{
field
:
'id'
,
title
:
'操作'
,
templet
:
'#operationTpl'
}
]],
...
...
@@ -30,7 +31,7 @@ form.on('submit(form1)', function (data) {
table
.
on
(
'tool(table1)'
,
function
(
obj
)
{
var
data
=
obj
.
data
;
if
(
obj
.
event
==
'delete'
)
{
layer
.
confirm
(
'真的要删除'
+
data
.
symbol
+
'吗?'
,
{
icon
:
3
,
title
:
'删除'
},
function
(
index
)
{
layer
.
confirm
(
'真的要删除'
+
data
.
coin_name
+
'吗?'
,
{
icon
:
3
,
title
:
'删除'
},
function
(
index
)
{
layer
.
close
(
index
);
//向服务端发送删除指令
$
.
get
(
'/admin/coin-supported-symbol/delete?id='
+
obj
.
data
.
id
,
function
(
data
,
status
)
{
...
...
@@ -42,3 +43,30 @@ table.on('tool(table1)', function (obj) {
});
}
});
$
(
'#add'
).
click
(
function
()
{
//打开弹窗
$
.
get
(
'/admin/coin-supported-symbol/add?platform_id='
+
platform_id
,
{},
function
(
str
)
{
var
index
=
layer
.
open
({
type
:
1
,
title
:
'添加数据'
,
id
:
'add-one'
,
skin
:
'layui-layer-lan'
,
area
:
[
'320px'
,
'auto'
],
content
:
str
,
btn
:
[
'确认'
,
'取消'
],
btn1
:
function
()
{
$
.
post
(
'/admin/coin-supported-symbol/add'
,
$
(
"#addData"
).
serialize
(),
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
rev
.
code
==
0
)
{
layer
.
close
(
index
);
table
.
reload
(
"table1"
,
{});
}
});
}
});
layui
.
form
.
render
();
});
return
false
;
});
\ 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