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
3e593713
Commit
3e593713
authored
Nov 07, 2018
by
ZhuChunYang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加币种配置批量删除
parent
56e68b1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
27 deletions
+31
-27
CoinController.php
backend/controllers/CoinController.php
+5
-6
package.php
backend/views/coin/package.php
+26
-21
No files found.
backend/controllers/CoinController.php
View file @
3e593713
...
@@ -387,15 +387,14 @@ class CoinController extends BaseController
...
@@ -387,15 +387,14 @@ class CoinController extends BaseController
}
}
return
[
'code'
=>
0
,
'msg'
=>
'复制成功'
];
return
[
'code'
=>
0
,
'msg'
=>
'复制成功'
];
}
}
return
[
'code'
=>
-
1
,
'msg'
=>
'没有权限
修改
'
];
return
[
'code'
=>
-
1
,
'msg'
=>
'没有权限
复制
'
];
}
}
}
}
public
function
actionPackageBatchDel
()
public
function
actionPackageBatchDel
()
{
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
if
(
Yii
::
$app
->
request
->
isAjax
)
{
/* Yii::$app->response->format = Response::FORMAT_JSON;
Yii
::
$app
->
response
->
format
=
Response
::
FORMAT_JSON
;
$get
=
Yii
::
$app
->
request
->
get
();
$get
=
Yii
::
$app
->
request
->
get
();
$platform_id
=
$get
[
'platform_id'
]
??
''
;
$platform_id
=
$get
[
'platform_id'
]
??
''
;
$coin_ids
=
$get
[
'coin_ids'
]
??
''
;
$coin_ids
=
$get
[
'coin_ids'
]
??
''
;
...
@@ -411,14 +410,14 @@ class CoinController extends BaseController
...
@@ -411,14 +410,14 @@ class CoinController extends BaseController
$coin
=
Coin
::
getOneById
(
$id
);
$coin
=
Coin
::
getOneById
(
$id
);
if
(
$coin
){
if
(
$coin
){
$platform_ids
=
explode
(
','
,
$coin
->
platform_id
);
$platform_ids
=
explode
(
','
,
$coin
->
platform_id
);
$platform_ids = implode(',', array_
unique(array_merge($platform_ids, [$platform_id])
));
$platform_ids
=
implode
(
','
,
array_
diff
(
$platform_ids
,
[
$platform_id
]
));
$coin
->
platform_id
=
$platform_ids
;
$coin
->
platform_id
=
$platform_ids
;
$coin
->
save
();
$coin
->
save
();
}
}
}
}
return ['code' => 0, 'msg' => '
复制
成功'];
return
[
'code'
=>
0
,
'msg'
=>
'
批量删除
成功'
];
}
}
return ['code' => -1, 'msg' => '没有权限
修改'];*/
return
[
'code'
=>
-
1
,
'msg'
=>
'没有权限
删除'
];
}
}
}
}
}
}
backend/views/coin/package.php
View file @
3e593713
...
@@ -217,27 +217,32 @@ table.on('toolbar(table1)', function(obj) {
...
@@ -217,27 +217,32 @@ table.on('toolbar(table1)', function(obj) {
}
}
});
});
}
else
if
(
event
==
'batch_del'
){
}
else
if
(
event
==
'batch_del'
){
var
checkStatus
=
table
.
checkStatus
(
'table1'
)
var
index
=
layer
.
confirm
(
"确认删除?"
,
{
,
data
=
checkStatus
.
data
;
icon
:
3
,
var
coin_ids
=
""
;
title
:
'删除'
$
.
each
(
data
,
function
(
index
,
value
){
},
function
()
{
if
(
coin_ids
){
var
checkStatus
=
table
.
checkStatus
(
'table1'
)
coin_ids
+=
","
+
value
.
id
;
,
data
=
checkStatus
.
data
;
}
else
{
var
coin_ids
=
""
;
coin_ids
=
value
.
id
;
$
.
each
(
data
,
function
(
index
,
value
){
}
if
(
coin_ids
){
});
coin_ids
+=
","
+
value
.
id
;
var
platform_id
=
$
(
"select[name='platform_id']"
).
val
();
}
else
{
$
.
get
(
'/admin/coin/package-batch-del'
,
{
coin_ids
:
coin_ids
,
platform_id
:
platform_id
},
function
(
rev
)
{
coin_ids
=
value
.
id
;
layer
.
msg
(
rev
.
msg
);
}
if
(
0
==
rev
.
code
)
{
});
layer
.
close
(
index
);
var
platform_id
=
$
(
"select[name='platform_id']"
).
val
();
table
.
reload
(
'table1'
,
{
$
.
get
(
'/admin/coin/package-batch-del'
,
{
coin_ids
:
coin_ids
,
platform_id
:
platform_id
},
function
(
rev
)
{
page
:
{
layer
.
msg
(
rev
.
msg
);
curr
:
1
if
(
0
==
rev
.
code
)
{
}
layer
.
close
(
index
);
});
table
.
reload
(
'table1'
,
{
}
page
:
{
curr
:
1
}
});
}
});
});
});
}
}
});
});
...
...
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