后台批量操作bug修复
内核更新
This commit is contained in:
@@ -103,23 +103,17 @@ class Action extends Admin {
|
||||
* @author colin <colin@tensent.cn>
|
||||
*/
|
||||
public function del(){
|
||||
if (IS_POST) {
|
||||
$ids = input('ids/a',array());
|
||||
$id = input('id','');
|
||||
array_push($ids, $id);
|
||||
if(empty($ids)){
|
||||
return $this->error("非法操作!",'');
|
||||
}
|
||||
$map['id'] = array('IN',$ids);
|
||||
$result = db('Action')->where($map)->delete();
|
||||
if ($result) {
|
||||
action_log('delete_action', 'Action', $id, session('user_auth.uid'));
|
||||
return $this->success('删除成功!');
|
||||
}else{
|
||||
return $this->error('删除失败!');
|
||||
}
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if(empty($id)){
|
||||
return $this->error("非法操作!",'');
|
||||
}
|
||||
$map['id'] = array('IN',$id);
|
||||
$result = db('Action')->where($map)->delete();
|
||||
if ($result) {
|
||||
action_log('delete_action', 'Action', $id, session('user_auth.uid'));
|
||||
return $this->success('删除成功!');
|
||||
}else{
|
||||
return $this->error("非法操作!");
|
||||
return $this->error('删除失败!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,15 +122,13 @@ class Action extends Admin {
|
||||
* @author colin <colin@tensent.cn>
|
||||
*/
|
||||
public function setstatus(){
|
||||
$ids = input('ids/a',array());
|
||||
$id = input('id','');
|
||||
array_push($ids, $id);
|
||||
if(empty($ids)){
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if(empty($id)){
|
||||
return $this->error("非法操作!",'');
|
||||
}
|
||||
$status = input('get.status','','trim,intval');
|
||||
$message = !$status ? '禁用' : '启用';
|
||||
$map['id'] = array('IN',$ids);
|
||||
$map['id'] = array('IN',$id);
|
||||
$result = db('Action')->where($map)->setField('status',$status);
|
||||
if ($result !== false) {
|
||||
action_log('setstatus_action', 'Action', $id, session('user_auth.uid'));
|
||||
@@ -193,17 +185,15 @@ class Action extends Admin {
|
||||
}
|
||||
/**
|
||||
* 删除日志
|
||||
* @param mixed $ids
|
||||
* @param mixed $id
|
||||
* @author huajie <banhuajie@163.com>
|
||||
*/
|
||||
public function dellog() {
|
||||
$ids = input('ids/a',array());
|
||||
$id = input('id','');
|
||||
array_push($ids, $id);
|
||||
if(empty($ids)){
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if(empty($id)){
|
||||
return $this->error("非法操作!",'');
|
||||
}
|
||||
$map['id'] = array('IN',$ids);
|
||||
$map['id'] = array('IN',$id);
|
||||
$res = db('ActionLog')->where($map)->delete();
|
||||
if ($res !== false) {
|
||||
action_log('delete_actionlog', 'ActionLog', $id, session('user_auth.uid'));
|
||||
|
||||
@@ -90,9 +90,9 @@ class Ad extends Admin {
|
||||
}
|
||||
|
||||
public function del(){
|
||||
$id = input('id','');
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
|
||||
if (!$id) {
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
$map['id'] = array('IN',$id);
|
||||
@@ -175,9 +175,9 @@ class Ad extends Admin {
|
||||
}
|
||||
|
||||
public function delad(){
|
||||
$id = input('id','');
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
|
||||
if (!$id) {
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
$map['id'] = array('IN',$id);
|
||||
|
||||
@@ -127,7 +127,7 @@ class Channel extends Admin{
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
public function del() {
|
||||
$id = array_unique((array)input('id', 0));
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
|
||||
if (empty($id)) {
|
||||
return $this->error('请选择要操作的数据!');
|
||||
|
||||
@@ -145,14 +145,12 @@ class Content extends Admin{
|
||||
* @author molong <ycgpp@126.com>
|
||||
*/
|
||||
public function del(){
|
||||
$id = input('id','','trim');
|
||||
$ids = input('post.ids',array());
|
||||
array_push($ids, $id);
|
||||
if (empty($ids)) {
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
|
||||
$map['id'] = array('IN',$ids);
|
||||
$map['id'] = array('IN',$id);
|
||||
$result = $this->model->del($map);
|
||||
|
||||
if ($result) {
|
||||
|
||||
@@ -97,11 +97,11 @@ class Group extends Admin {
|
||||
|
||||
//会员分组删除控制器
|
||||
public function del(){
|
||||
$id = input('id','','trim,intval');
|
||||
if (!$id) {
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
$result = $this->group->where(array('id'=>$id))->delete();
|
||||
$result = $this->group->where(array('id'=>array('IN', $id)))->delete();
|
||||
if ($result) {
|
||||
return $this->success("删除成功!");
|
||||
}else{
|
||||
@@ -113,7 +113,7 @@ class Group extends Admin {
|
||||
public function access($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(10);
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(15);
|
||||
|
||||
$data = array(
|
||||
'list' => $list,
|
||||
|
||||
@@ -84,7 +84,11 @@ class Link extends Admin{
|
||||
}
|
||||
|
||||
//删除
|
||||
public function delete($id){
|
||||
public function delete(){
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if (empty($id)) {
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
$link = db('Link');
|
||||
|
||||
$map = array('id'=>array('IN',$id));
|
||||
|
||||
@@ -123,7 +123,7 @@ class Menu extends Admin{
|
||||
* @author yangweijie <yangweijiester@gmail.com>
|
||||
*/
|
||||
public function del(){
|
||||
$id = array_unique((array)input('id',0));
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
|
||||
if ( empty($id) ) {
|
||||
return $this->error('请选择要操作的数据!');
|
||||
@@ -133,7 +133,7 @@ class Menu extends Admin{
|
||||
if(db('Menu')->where($map)->delete()){
|
||||
session('admin_menu_list',null);
|
||||
//记录行为
|
||||
action_log('update_menu', 'Menu', $id, UID);
|
||||
action_log('update_menu', 'Menu', $id, session('user_auth.uid'));
|
||||
return $this->success('删除成功');
|
||||
} else {
|
||||
return $this->error('删除失败!');
|
||||
|
||||
@@ -97,11 +97,11 @@ class Seo extends Admin{
|
||||
}
|
||||
|
||||
public function del(){
|
||||
$id = input('id','','trim,intval');
|
||||
if (!$id) {
|
||||
$id = array_unique((array)$this->param['id']);
|
||||
if (empty($id)) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
$result = db('SeoRule')->where(array('id'=>$id))->delete();
|
||||
$result = db('SeoRule')->where(array('id'=>array('IN',$id)))->delete();
|
||||
if ($result) {
|
||||
return $this->success("删除成功!");
|
||||
}else{
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
{volist name="list" id="vo"}
|
||||
<tr>
|
||||
<td>
|
||||
<input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" />
|
||||
<input class="ids" type="checkbox" name="id[]" value="{$vo['id']}" />
|
||||
</td>
|
||||
<td>{$vo.id}</td>
|
||||
<td>{$vo.name}</td>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<tbody>
|
||||
{volist name="list" id="vo"}
|
||||
<tr>
|
||||
<td><input class="ids" type="checkbox" name="ids[]" value="{$vo['id']}" /></td>
|
||||
<td><input class="ids" type="checkbox" name="id[]" value="{$vo['id']}" /></td>
|
||||
<td>{$vo['id']} </td>
|
||||
<td>{:get_action($vo['action_id'],'title')}</td>
|
||||
<td>{:get_nickname($vo['user_id'])}</td>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30"><input class="checkbox check-all" type="checkbox"></th>
|
||||
<th width="60">ID</th>
|
||||
<th>组名</th>
|
||||
<th>标识</th>
|
||||
@@ -45,6 +46,7 @@
|
||||
<tbody>
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<th width="30"><input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}"></th>
|
||||
<td>{$item['id']}</td>
|
||||
<td>{$item['title']}</td>
|
||||
<td>{$item['name']}</td>
|
||||
|
||||
Reference in New Issue
Block a user