From b80acdefbec2da60a253974628dd79d06863a7c3 Mon Sep 17 00:00:00 2001 From: dengbw Date: Fri, 19 May 2023 11:50:55 +0800 Subject: [PATCH] market_delete --- market/controllers/api/sylive/Goods.php | 2 +- market/controllers/api/sylive/Members.php | 18 ++++++++++++++++++ market/controllers/api/system/Dictionary.php | 18 ++++++++++++++++++ .../controllers/api/system/DictionaryData.php | 2 +- market/controllers/api/system/Menu.php | 18 ++++++++++++++++++ market/controllers/api/system/Role.php | 2 +- market/controllers/api/system/RoleMenu.php | 10 +++++----- 7 files changed, 62 insertions(+), 8 deletions(-) diff --git a/market/controllers/api/sylive/Goods.php b/market/controllers/api/sylive/Goods.php index 9826fa43..9219245a 100644 --- a/market/controllers/api/sylive/Goods.php +++ b/market/controllers/api/sylive/Goods.php @@ -214,7 +214,7 @@ class Goods extends BaseController */ public function batch_delete() { - $ids = $this->inputs; + $ids = $this->input_param('ids'); if (!$ids) { $this->return_json('参数错误'); } diff --git a/market/controllers/api/sylive/Members.php b/market/controllers/api/sylive/Members.php index 06577eb2..4cb7892b 100644 --- a/market/controllers/api/sylive/Members.php +++ b/market/controllers/api/sylive/Members.php @@ -249,6 +249,24 @@ class Members extends BaseController $this->return_response(); } + /** + * Notes:批量删除用户 + * Created on: 2022/9/19 15:35 + * Created by: dengbw + */ + public function batch_delete() + { + $ids = $this->input_param('ids'); + if (!$ids) { + $this->return_json('参数错误'); + } + $str_ids = implode(',', $ids); + if ($str_ids) { + $this->mdSyliveUser->update(['status' => -1], ["userId in($str_ids)" => null]); + } + $this->return_response(); + } + /** * Notes:栓验字段 * Created on: 2022/9/21 15:52 diff --git a/market/controllers/api/system/Dictionary.php b/market/controllers/api/system/Dictionary.php index 07b7660d..a4a9b545 100644 --- a/market/controllers/api/system/Dictionary.php +++ b/market/controllers/api/system/Dictionary.php @@ -104,4 +104,22 @@ class Dictionary extends BaseController $this->return_response(); } + /** + * Notes:批量删除字典 + * Created on: 2022/10/21 17:11 + * Created by: dengbw + */ + public function batch_delete() + { + $ids = $this->input_param('ids'); + if (!$ids) { + $this->return_json('参数错误'); + } + $str_ids = implode(',', $ids); + if ($str_ids) { + $this->mdSysDictionary->update(['status' => -1], ["dictId in($str_ids)" => null]); + } + $this->return_response(); + } + } \ No newline at end of file diff --git a/market/controllers/api/system/DictionaryData.php b/market/controllers/api/system/DictionaryData.php index 99e356c4..722ca67b 100644 --- a/market/controllers/api/system/DictionaryData.php +++ b/market/controllers/api/system/DictionaryData.php @@ -155,7 +155,7 @@ class DictionaryData extends BaseController */ public function batch_delete() { - $ids = $this->inputs; + $ids = $this->input_param('ids'); if (!$ids) { $this->return_json('参数错误'); } diff --git a/market/controllers/api/system/Menu.php b/market/controllers/api/system/Menu.php index ed5295ef..95254a0a 100644 --- a/market/controllers/api/system/Menu.php +++ b/market/controllers/api/system/Menu.php @@ -133,4 +133,22 @@ class Menu extends BaseController $this->return_response(); } + /** + * Notes:批量删除菜单 + * Created on: 2022/10/21 17:11 + * Created by: dengbw + */ + public function batch_delete() + { + $ids = $this->input_param('ids'); + if (!$ids) { + $this->return_json('参数错误'); + } + $str_ids = implode(',', $ids); + if ($str_ids) { + $this->mdSysMenu->update(['status' => -1], ["menuId in($str_ids)" => null]); + } + $this->return_response(); + } + } \ No newline at end of file diff --git a/market/controllers/api/system/Role.php b/market/controllers/api/system/Role.php index 63521a00..8317506f 100644 --- a/market/controllers/api/system/Role.php +++ b/market/controllers/api/system/Role.php @@ -129,7 +129,7 @@ class Role extends BaseController */ public function batch_delete() { - $roleIds = $this->inputs; + $roleIds = $this->input_param('ids'); if (!$roleIds) { $this->return_json('参数错误'); } diff --git a/market/controllers/api/system/RoleMenu.php b/market/controllers/api/system/RoleMenu.php index 2bb9a32d..00e6d133 100644 --- a/market/controllers/api/system/RoleMenu.php +++ b/market/controllers/api/system/RoleMenu.php @@ -20,10 +20,10 @@ class RoleMenu extends BaseController * Notes:获取角色分配的菜单 (ele-admin:/system/role-menu) * Created on: 2022/9/13 9:47 * Created by: dengbw - * @param $roleId */ - public function index_get($roleId) + public function index_get() { + $roleId = $this->input_param('roleId'); if (!$roleId) { $this->return_json('参数错误'); } @@ -50,14 +50,14 @@ class RoleMenu extends BaseController * Notes:修改角色菜单(ele-admin:/system/role-menu) * Created on: 2022/9/13 11:50 * Created by: dengbw - * @param $roleId */ - public function index_put($roleId) + public function index_put() { + $roleId = $this->input_param('roleId'); if (!$roleId) { $this->return_json('参数错误'); } - $menuIds = $this->inputs; + $menuIds = $this->input_param('menuIds'); $menuIds = $menuIds ? implode(',', $menuIds) : ''; $this->mdSysRole->update(['menuIds' => $menuIds], ['roleId' => $roleId]); $this->return_response();