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
cd538ca7
Commit
cd538ca7
authored
Aug 09, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/airdrop
parents
83880703
bb2e349a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
188 additions
and
7 deletions
+188
-7
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
ExchangeBusiness.php
common/business/ExchangeBusiness.php
+4
-4
CoinController.php
h5/controllers/CoinController.php
+3
-3
No files found.
backend/assets/platformCoins/IndexAsset.php
0 → 100644
View file @
cd538ca7
<?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 @
cd538ca7
<?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 @
cd538ca7
<?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 @
cd538ca7
/**
* @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
common/business/ExchangeBusiness.php
View file @
cd538ca7
...
...
@@ -82,7 +82,7 @@ class ExchangeBusiness
goto
doEnd
;
}
if
(
strtoupper
(
$tag
)
==
'TSC'
||
strtoupper
(
$tag
)
==
'WL'
||
strtoupper
(
$tag
)
==
'ETS'
||
strtoupper
(
$tag
)
==
'LIMS'
||
strtoupper
(
$tag
)
==
'AT'
||
strtoupper
(
$tag
)
==
'BTJ'
)
{
if
(
strtoupper
(
$tag
)
==
'
CIC'
||
strtoupper
(
$tag
)
==
'RYH'
||
strtoupper
(
$tag
)
==
'
TSC'
||
strtoupper
(
$tag
)
==
'WL'
||
strtoupper
(
$tag
)
==
'ETS'
||
strtoupper
(
$tag
)
==
'LIMS'
||
strtoupper
(
$tag
)
==
'AT'
||
strtoupper
(
$tag
)
==
'BTJ'
)
{
$quotation
=
[
'low'
=>
0
,
'high'
=>
0
,
...
...
@@ -271,20 +271,20 @@ class ExchangeBusiness
if
(
count
(
$condition
[
0
])
>
1
)
{
foreach
(
$condition
as
$val
)
{
if
(
'null'
==
$val
[
1
]
||
'coin'
==
$val
[
1
])
{
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty'
)
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,
introduce,
platform,chain,address as contract_address,treaty'
)
->
where
([
'name'
=>
$val
[
0
]])
->
asArray
()
->
one
();
continue
;
}
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty'
)
$data
[]
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,
introduce,
platform,chain,address as contract_address,treaty'
)
->
where
([
'name'
=>
$val
[
0
]])
->
andWhere
([
'platform'
=>
$val
[
1
]])
->
asArray
()
->
one
();
}
}
else
{
$data
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,platform,chain,address as contract_address,treaty'
)
$data
=
Coin
::
find
()
->
select
(
'id,sid,icon,name,optional_name,nickname,
introduce,
platform,chain,address as contract_address,treaty'
)
->
where
([
'in'
,
'name'
,
$condition
])
->
asArray
()
->
all
();
}
...
...
h5/controllers/CoinController.php
View file @
cd538ca7
...
...
@@ -62,11 +62,11 @@ class CoinController extends BaseController
$names
=
[
$names
];
}
$condition
=
$names
;
$fields
=
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
,
'address as contract_address'
,
'introduce'
];
$result
=
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
,
$fields
);
$fields
=
[
'id'
,
'sid'
,
'icon'
,
'name'
,
'nickname'
,
'platform'
,
'chain'
,
'address as contract_address'
,
'introduce'
];
$result
=
ExchangeBusiness
::
getApiListForIndex
(
1
,
999
,
$condition
,
$fields
);
if
(
$result
)
{
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
$result
[
'data'
]);
}
else
{
}
else
{
$response_
->
build
(
ResponseBuild
::
STATUS_SUCCEED
,
''
,
[]);
}
return
$response_
;
...
...
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