feat(backend): 新增多个后台功能接口
- 新增考评级别相关接口 - 新增站内信相关接口 - 新增党风教育相关接口 - 新增加减分记录导出功能 - 新增月度自评审核通知功能 - 优化月度自评数据插入逻辑
This commit is contained in:
		
							parent
							
								
									e396a59403
								
							
						
					
					
						commit
						418bf4c1e6
					
				@ -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('审核操作失败');
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user