Commit 3e593713 authored by ZhuChunYang's avatar ZhuChunYang

添加币种配置批量删除

parent 56e68b1b
...@@ -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' => '没有权限删除'];
} }
} }
} }
...@@ -217,6 +217,10 @@ table.on('toolbar(table1)', function(obj) { ...@@ -217,6 +217,10 @@ table.on('toolbar(table1)', function(obj) {
} }
}); });
}else if(event == 'batch_del'){ }else if(event == 'batch_del'){
var index = layer.confirm("确认删除?", {
icon: 3,
title: '删除'
}, function() {
var checkStatus = table.checkStatus('table1') var checkStatus = table.checkStatus('table1')
,data = checkStatus.data; ,data = checkStatus.data;
var coin_ids = ""; var coin_ids = "";
...@@ -239,6 +243,7 @@ table.on('toolbar(table1)', function(obj) { ...@@ -239,6 +243,7 @@ table.on('toolbar(table1)', function(obj) {
}); });
} }
}); });
});
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment