From 418bf4c1e6913dc9f255dfb4daba7962eeabbd3d Mon Sep 17 00:00:00 2001 From: qinzexin <“731344816@qq.com”> Date: Tue, 1 Apr 2025 18:09:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(backend):=20=E6=96=B0=E5=A2=9E=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E5=90=8E=E5=8F=B0=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增考评级别相关接口 - 新增站内信相关接口 - 新增党风教育相关接口 - 新增加减分记录导出功能 - 新增月度自评审核通知功能 - 优化月度自评数据插入逻辑 --- .../backend/AdditionAndSubtractionRecords.php | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/application/api/controller/backend/AdditionAndSubtractionRecords.php b/application/api/controller/backend/AdditionAndSubtractionRecords.php index f20658b..ef2d781 100644 --- a/application/api/controller/backend/AdditionAndSubtractionRecords.php +++ b/application/api/controller/backend/AdditionAndSubtractionRecords.php @@ -300,5 +300,59 @@ class AdditionAndSubtractionRecords extends Api } return $this->error('审核失败'); } - + + public function plexamine() + { + // 接收原始参数 + $idsParam = $this->request->post('ids'); + $status = $this->request->post('status'); + + // 权限验证 + $level = Db::name('auth_group') + ->where('id', $this->auth_group) + ->value('level'); + if ($level == 2) { + return $this->error('您没有审核权限'); + } + + // 参数预处理 + $ids = []; + if (!empty($idsParam)) { + // 将字符串转换为数组并过滤无效ID + $ids = array_filter(explode(',', $idsParam), function($id) { + return is_numeric($id) && $id > 0; + }); + } + + // 参数校验 + if (empty($ids) || !$status) { + return $this->error('缺少必要参数或包含无效ID'); + } + + // 构造批量更新条件 + $where = [ + 'id' => ['in', $ids] + ]; + + $update = [ + 'status' => $status, + // 'updatetime' => time() + ]; + + // 执行批量更新 + $affectedRows = Db::name('addition_and_subtraction_records') + ->where($where) + ->update($update); + + // 结果处理 + if ($affectedRows !== false) { + if ($affectedRows > 0) { + return $this->success("成功更新{$affectedRows}条记录"); + } + return $this->error('未找到可更新的记录'); + } + + return $this->error('审核操作失败'); + } + }