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
5900266d
Commit
5900266d
authored
Jan 11, 2019
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
旷工费修改
parent
f226bbe7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
8 deletions
+44
-8
ServiceController.php
api/controllers/ServiceController.php
+2
-2
MinerFeeController.php
backend/controllers/MinerFeeController.php
+23
-0
index.php
backend/views/miner-fee/index.php
+17
-6
MinerFee.php
common/models/psources/MinerFee.php
+2
-0
No files found.
api/controllers/ServiceController.php
View file @
5900266d
...
...
@@ -107,8 +107,8 @@ class ServiceController extends BaseController
if
(
!
$coin
){
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'币种不能为空'
];
}
$fee
=
MinerFee
::
find
()
->
where
([
'platform'
=>
$coin
,
'type'
=>
2
])
->
asArray
()
->
one
();
if
(
!
$fee
||
!
$fee
[
'min'
]
){
$fee
=
MinerFee
::
find
()
->
where
([
'platform'
=>
$coin
,
'type'
=>
2
])
->
select
(
'id,platform,type,fee,create_at,update_at'
)
->
asArray
()
->
one
();
if
(
!
$fee
){
return
[
'code'
=>
1
,
'data'
=>
[],
'msg'
=>
'旷工费未设置'
];
}
return
[
'code'
=>
0
,
'data'
=>
$fee
,
'msg'
=>
'旷工费获取成功'
];
...
...
backend/controllers/MinerFeeController.php
View file @
5900266d
...
...
@@ -170,4 +170,26 @@ class MinerFeeController extends BaseController
return
[
'code'
=>
0
,
'msg'
=>
'币种库更新成功'
];
}
}
public
function
actionSetFee
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
get
(
'id'
,
''
);
$fee
=
$request
->
get
(
'fee'
,
0
);
if
(
$id
){
$minerFee
=
MinerFee
::
find
()
->
where
([
'id'
=>
$id
])
->
one
();
if
(
!
$minerFee
){
return
[
'code'
=>
1
,
'msg'
=>
'币种旷工费异常'
];
}
$minerFee
->
fee
=
$fee
;
$minerFee
->
update_at
=
date
(
'Y-m-d H:i:s'
);
$minerFee
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'旷工费设置成功'
];
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'旷工费设置失败'
];
}
}
}
}
\ No newline at end of file
backend/views/miner-fee/index.php
View file @
5900266d
...
...
@@ -26,7 +26,7 @@
</div>
<div
class=
"layui-tab-item"
>
<button
class=
"layui-btn layui-btn-default"
id=
"update-coin"
>
更新币种库
</button>
<table
class=
"layui-table"
id=
"table2"
></table>
<table
class=
"layui-table"
id=
"table2"
lay-filter=
"table2"
></table>
</div>
</div>
...
...
@@ -56,12 +56,9 @@
cols
:
[[
{
field
:
'id'
,
title
:
'ID'
},
{
field
:
'platform'
,
title
:
'币种'
},
{
field
:
'min'
,
title
:
'最小值'
},
{
field
:
'max'
,
title
:
'最大值'
},
{
field
:
'level'
,
title
:
'分档'
},
{
field
:
'fee'
,
title
:
'旷工费'
,
edit
:
'text'
},
{
field
:
'create_at'
,
title
:
'创建时间'
},
{
field
:
'update_at'
,
title
:
'更新时间'
},
{
field
:
'id'
,
title
:
'操作'
,
templet
:
"#operatorTpl"
}
]],
url
:
'/admin/miner-fee/cost?type=2'
});
...
...
@@ -77,7 +74,21 @@
});
}
});
})
});
//监听单元格编辑
table
.
on
(
'edit(table2)'
,
function
(
obj
){
var
value
=
obj
.
value
;
//得到修改后的值
var
data
=
obj
.
data
;
//得到所在行所有键值
$
.
get
(
'/admin/miner-fee/set-fee'
,
{
id
:
data
.
id
,
fee
:
value
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
table
.
reload
(
'table2'
,{});
}
else
{
}
});
});
</script>
<script
type=
"text/html"
id=
"operatorTpl"
>
<
a
href
=
"/admin/miner-fee/edit?id={{d.id}}&type={{d.type}}"
>
...
...
common/models/psources/MinerFee.php
View file @
5900266d
...
...
@@ -40,4 +40,5 @@ class MinerFee extends BaseActiveRecord
$data
=
$query
->
offset
((
$page
-
1
)
*
10
)
->
limit
(
$limit
)
->
asArray
()
->
all
();
return
[
'count'
=>
$count
,
'data'
=>
$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