From ddf31f3fbecdf4400e536bfceed540497a1da5e5 Mon Sep 17 00:00:00 2001 From: miguannan <53815784+javami888@users.noreply.github.com> Date: Thu, 21 May 2026 19:39:28 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=E8=B4=A8=E6=A3=80=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E8=B5=84=E6=96=99=E7=9B=B8=E5=85=B3=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 913a017f3d091bc0d8944c8d8be3958f068f2c28. --- back/application/api/controller/Material.php | 37 +- back/application/api/controller/Role.php | 2 +- .../api/controller_74GYL3/Material.php | 42 +- .../api/controller_74GYL3/Role.php | 2 +- front/src/views/components/Materials.vue | 819 ++++++++---------- 5 files changed, 364 insertions(+), 538 deletions(-) diff --git a/back/application/api/controller/Material.php b/back/application/api/controller/Material.php index 3287a5d..3c740b1 100644 --- a/back/application/api/controller/Material.php +++ b/back/application/api/controller/Material.php @@ -55,7 +55,6 @@ class Material extends Common $insert_info['create_time'] = $param['create_time']; db('materials_info')->insert($insert_info); - return $this->sendSuccess('添加成功'); } @@ -80,44 +79,24 @@ class Material extends Common //项目基础信息 else if (1 == $param['materials_class'] ) { - $currPage = empty($param['currPage']) ? 1 : $param['currPage']; - $pageSize = empty($param['pageSize']) ? 10 : $param['pageSize']; - - $countQuery = db('materials_info')->alias('p') - ->where('p.materials_class', $param['materials_class']) - ->where('p.materials_owner', $param['materials_owner']); - $listQuery = db('materials_info')->alias('p') + $MaterialsInfoList = db('materials_info') + ->alias('p') ->join('materials_type s', 's.type_id = p.materials_type', 'left') ->where('p.materials_class', $param['materials_class']) ->where('p.materials_owner', $param['materials_owner']); - if (!empty($param['materials_type'])) { - if (is_array($param['materials_type'])) { - $countQuery->whereIn('p.materials_type', $param['materials_type']); - $listQuery->whereIn('p.materials_type', $param['materials_type']); - } else { - $countQuery->where('p.materials_type', $param['materials_type']); - $listQuery->where('p.materials_type', $param['materials_type']); - } + if (isset($param['materials_type']) && is_array($param['materials_type']) && count($param['materials_type']) > 0) { + $MaterialsInfoList->whereIn('p.materials_type', $param['materials_type']); + } elseif (isset($param['materials_type'])) { + $MaterialsInfoList->where('p.materials_type', $param['materials_type']); } - if (!empty($param['start_time'])) { - $countQuery->where('p.create_time', '>=', $param['start_time']); - $listQuery->where('p.create_time', '>=', $param['start_time']); - } - if (!empty($param['end_time'])) { - $countQuery->where('p.create_time', '<=', $param['end_time']); - $listQuery->where('p.create_time', '<=', $param['end_time']); - } - - $total = $countQuery->count(); - $list = $listQuery - ->page($currPage, $pageSize) + $MaterialsInfoList = $MaterialsInfoList ->order('p.create_time desc') ->field('p.*, s.type_name as materials_type_name') ->select(); - return $this->sendSuccess(['list' => $list, 'total' => $total]); + return $this->sendSuccess($MaterialsInfoList); } //问题单信息 diff --git a/back/application/api/controller/Role.php b/back/application/api/controller/Role.php index 1c22e8f..1d17ecc 100644 --- a/back/application/api/controller/Role.php +++ b/back/application/api/controller/Role.php @@ -56,7 +56,7 @@ class Role extends Common $results = db('system_router')->alias('router') ->join('system_role', 'system_role.router_id = router.id OR system_role.router_id LIKE concat(router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id) OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\')', 'LEFT') ->field('router.*, GROUP_CONCAT(system_role.role_name) as roles') - ->group('router.id') + ->group('router.path') ->select(); $this->sendSuccess($results); } diff --git a/back/application/api/controller_74GYL3/Material.php b/back/application/api/controller_74GYL3/Material.php index 2b093f3..3f719fd 100644 --- a/back/application/api/controller_74GYL3/Material.php +++ b/back/application/api/controller_74GYL3/Material.php @@ -54,7 +54,6 @@ class Material extends Common $insert_info['create_time'] = $param['create_time']; db('materials_info')->insert($insert_info); - return $this->sendSuccess('添加成功'); } @@ -79,38 +78,15 @@ class Material extends Common //项目基础信息 else if (1 == $param['materials_class'] ) { - $currPage = empty($param['currPage']) ? 1 : $param['currPage']; - $pageSize = empty($param['pageSize']) ? 10 : $param['pageSize']; - - $countQuery = db('materials_info')->alias('p') - ->where('p.materials_class', $param['materials_class']) - ->where('p.materials_owner', $param['materials_owner']); - $listQuery = db('materials_info')->alias('p') - ->join('materials_type s', 's.type_id = p.materials_type', 'left') - ->where('p.materials_class', $param['materials_class']) - ->where('p.materials_owner', $param['materials_owner']); - - if (!empty($param['materials_type'])) { - $countQuery->where('p.materials_type', $param['materials_type']); - $listQuery->where('p.materials_type', $param['materials_type']); - } - - if (!empty($param['start_time'])) { - $countQuery->where('p.create_time', '>=', $param['start_time']); - $listQuery->where('p.create_time', '>=', $param['start_time']); - } - if (!empty($param['end_time'])) { - $countQuery->where('p.create_time', '<=', $param['end_time']); - $listQuery->where('p.create_time', '<=', $param['end_time']); - } - - $total = $countQuery->count(); - $list = $listQuery - ->page($currPage, $pageSize) - ->order('p.create_time desc') - ->field('p.*, s.type_name as materials_type_name') - ->select(); - return $this->sendSuccess(['list' => $list, 'total' => $total]); + $MaterialsInfoList = db('materials_info')->alias('p') + ->join('materials_type s', 's.type_id =p.materials_type', 'left') + ->where('p.materials_class', $param['materials_class']) + ->where('p.materials_owner', $param['materials_owner']) + ->where('p.materials_type', $param['materials_type']) + ->order('p.create_time desc') + ->field('p.*, s.type_name as materials_type_name') + ->select(); + return $this->sendSuccess($MaterialsInfoList); } //问题单信息 diff --git a/back/application/api/controller_74GYL3/Role.php b/back/application/api/controller_74GYL3/Role.php index 1c22e8f..1d17ecc 100644 --- a/back/application/api/controller_74GYL3/Role.php +++ b/back/application/api/controller_74GYL3/Role.php @@ -56,7 +56,7 @@ class Role extends Common $results = db('system_router')->alias('router') ->join('system_role', 'system_role.router_id = router.id OR system_role.router_id LIKE concat(router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id) OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\') OR system_role.router_id LIKE concat(\'%,\', router.id, \',%\')', 'LEFT') ->field('router.*, GROUP_CONCAT(system_role.role_name) as roles') - ->group('router.id') + ->group('router.path') ->select(); $this->sendSuccess($results); } diff --git a/front/src/views/components/Materials.vue b/front/src/views/components/Materials.vue index 8b7b474..578d903 100644 --- a/front/src/views/components/Materials.vue +++ b/front/src/views/components/Materials.vue @@ -1,202 +1,124 @@ + \ No newline at end of file