'require|checkData', 'inspection_id' => 'require|checkInspection', 'problem_cate' => 'require', 'problem_description' => 'require', 'problem_name' => 'require', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'inspection_id' => '巡视id', 'problem_cate' => '问题分类', 'problem_description' => '问题说明', 'problem_name' => '问题名称', ]; /** * @notes 添加场景 * @return SupervisionInspectionProblemValidate * @author likeadmin * @date 2024/02/26 17:18 */ public function sceneAdd() { return $this->only(['inspection_id','problem_cate','problem_description','problem_name']); } /** * @notes 编辑场景 * @return SupervisionInspectionProblemValidate * @author likeadmin * @date 2024/02/26 17:18 */ public function sceneEdit() { return $this->only(['id','inspection_id','problem_cate','problem_description','problem_name']); } /** * @notes 删除场景 * @return SupervisionInspectionProblemValidate * @author likeadmin * @date 2024/02/26 17:18 */ public function sceneDelete() { return $this->only(['id']); } /** * @notes 详情场景 * @return SupervisionInspectionProblemValidate * @author likeadmin * @date 2024/02/26 17:18 */ public function sceneDetail() { return $this->only(['id']); } public function checkData($value): bool|string { $data = SupervisionInspectionProblem::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '数据不存在'; } return true; } public function checkInspection($value): bool|string { $data = SupervisionInspection::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '巡视信息不存在'; } return true; } }