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
85290268
Commit
85290268
authored
Jan 14, 2019
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
10909296
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
2 deletions
+92
-2
CoinPublishController.php
backend/controllers/CoinPublishController.php
+43
-0
form.php
backend/views/coin-publish-rule/form.php
+0
-1
form_add.php
backend/views/coin-publish-rule/form_add.php
+0
-1
list.php
backend/views/coin-publish/list.php
+4
-0
list.js
backend/web/js/coin-publish/list.js
+39
-0
CoinPublish.php
common/models/psources/CoinPublish.php
+6
-0
No files found.
backend/controllers/CoinPublishController.php
View file @
85290268
...
...
@@ -110,4 +110,46 @@ class CoinPublishController extends BaseController
}
return
[
'code'
=>
-
1
,
'msg'
=>
'failed'
];
}
public
function
actionSetAutoCheck
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
get
(
'id'
,
''
);
$enable
=
$request
->
get
(
'enable'
,
1
);
if
(
$id
){
$publish
=
CoinPublish
::
getPublish
(
$id
);
if
(
!
$publish
){
return
[
'code'
=>
1
,
'msg'
=>
'币种监控不存在,不能设置自动审核'
];
}
$publish
->
auto_check
=
$enable
;
$publish
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'自动审核设置成功'
];
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'自动审核设置失败'
];
}
}
}
public
function
actionSetLimit
()
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
Yii
::
$app
->
response
->
format
=
'json'
;
$request
=
Yii
::
$app
->
request
;
$id
=
$request
->
get
(
'id'
,
''
);
$auto_check_limit
=
$request
->
get
(
'auto_check_limit'
);
if
(
$id
&&
$auto_check_limit
){
$publish
=
CoinPublish
::
getPublish
(
$id
);
if
(
!
$publish
){
return
[
'code'
=>
1
,
'msg'
=>
'币种监控不存在,不能设置自动审核'
];
}
$publish
->
auto_check_limit
=
$auto_check_limit
;
$publish
->
save
();
return
[
'code'
=>
0
,
'msg'
=>
'自动审核上限值设置成功'
];
}
else
{
return
[
'code'
=>
1
,
'msg'
=>
'自动审核上限值设置失败'
];
}
}
}
}
\ No newline at end of file
backend/views/coin-publish-rule/form.php
View file @
85290268
...
...
@@ -34,7 +34,6 @@
<label
class=
"layui-form-label"
style=
"width: 110px;"
>
类型
</label>
<div
class=
"layui-input-block"
>
<select
name=
"type"
class=
"layui-input"
>
<option
value=
"0"
></option>
<option
value=
"1"
>
按锁仓总量释放
</option>
<option
value=
"2"
>
按锁仓余量释放
</option>
</select>
...
...
backend/views/coin-publish-rule/form_add.php
View file @
85290268
...
...
@@ -34,7 +34,6 @@
<label
class=
"layui-form-label"
style=
"width: 110px;"
>
类型
</label>
<div
class=
"layui-input-block"
>
<select
name=
"type"
class=
"layui-input"
>
<option
value=
"0"
></option>
<option
value=
"1"
>
按锁仓总量释放
</option>
<option
value=
"2"
>
按锁仓余量释放
</option>
</select>
...
...
backend/views/coin-publish/list.php
View file @
85290268
...
...
@@ -29,3 +29,6 @@ IndexAsset::register($this);
<
a
class
=
"layui-btn layui-btn-danger layui-btn-xs"
lay
-
event
=
"del"
>
删除
<
/a
>
<?php
endif
;
?>
</script>
<script
type=
"text/html"
id=
"autoCheckTpl"
>
<
input
type
=
"checkbox"
name
=
"auto_check"
value
=
"{{d.id}}"
lay
-
skin
=
"switch"
lay
-
text
=
"是|否"
lay
-
filter
=
"autoCheckDemo"
{{
d
.
auto_check
==
1
?
'checked'
:
''
}}
>
</script>
\ No newline at end of file
backend/web/js/coin-publish/list.js
View file @
85290268
...
...
@@ -17,6 +17,13 @@ table.render({
return
d
.
amount
/
1
e8
;
}
},
{
field
:
'auto_check_limit'
,
title
:
'自动审核上限值'
,
edit
:
'text'
},
{
title
:
'自动审核'
,
field
:
'auto_check'
,
templet
:
'#autoCheckTpl'
,
width
:
100
},
{
toolbar
:
'#toolbar'
,
title
:
'操作'
}
]],
});
...
...
@@ -100,3 +107,34 @@ $('#add').click(function () {
return
false
;
});
var
form
=
layui
.
form
;
form
.
render
();
form
.
on
(
'switch(autoCheckDemo)'
,
function
(
obj
){
var
enable
=
1
;
if
(
obj
.
elem
.
checked
){
enable
=
1
}
else
{
enable
=
0
;
}
$
.
get
(
'/admin/coin-publish/set-auto-check'
,
{
id
:
this
.
value
,
enable
:
enable
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
}
else
{
}
});
});
//监听单元格编辑
table
.
on
(
'edit(table1)'
,
function
(
obj
){
var
value
=
obj
.
value
;
//得到修改后的值
var
data
=
obj
.
data
;
//得到所在行所有键值
$
.
get
(
'/admin/coin-publish/set-limit'
,
{
id
:
data
.
id
,
auto_check_limit
:
value
},
function
(
rev
)
{
layer
.
msg
(
rev
.
msg
);
if
(
0
==
rev
.
code
)
{
table
.
reload
(
'table1'
,{});
}
else
{
}
});
});
\ No newline at end of file
common/models/psources/CoinPublish.php
View file @
85290268
...
...
@@ -31,4 +31,10 @@ class CoinPublish extends BaseActiveRecord
return
'{{%coin_publish}}'
;
}
public
static
function
getPublish
(
$id
)
{
return
self
::
find
()
->
where
([
'id'
=>
$id
])
->
one
();
}
}
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