From 4a7126bf5719a62dc3fd493ba7be4b687e9449f2 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Tue, 27 Feb 2024 11:53:31 +0800 Subject: [PATCH] update --- .../supervision_work/SupervisionInspectionLogic.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/adminapi/logic/supervision_work/SupervisionInspectionLogic.php b/app/adminapi/logic/supervision_work/SupervisionInspectionLogic.php index f6a18955b..f55a55d3f 100644 --- a/app/adminapi/logic/supervision_work/SupervisionInspectionLogic.php +++ b/app/adminapi/logic/supervision_work/SupervisionInspectionLogic.php @@ -185,6 +185,16 @@ class SupervisionInspectionLogic extends BaseLogic */ public static function delete(array $params): bool { + $inspection_result = SupervisionInspectionResult::where('inspection_id',$params['id'])->findOrEmpty(); + if(!$inspection_result->isEmpty()){ + self::setError('该巡视内容下存在巡视结果数据,请先删除巡视结果数据'); + return false; + } + $inspection_problem = SupervisionInspectionProblem::where('inspection_id',$params['id'])->findOrEmpty(); + if(!$inspection_problem->isEmpty()){ + self::setError('该巡视内容下存在巡视问题数据,请先删除巡视问题数据'); + return false; + } return SupervisionInspection::destroy($params['id']); }