'require|checkData', 'notice_id' => 'require|checkNotice', 'problem_description' => 'require', 'content_description' => 'require', 'demand_description' => 'require', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'notice_id' => '通知id', 'problem_description' => '事由描述', 'content_description' => '内容描述', 'demand_description' => '要求描述', ]; /** * @notes 添加场景 * @return SupervisionNoticeProblemValidate * @author likeadmin * @date 2024/03/01 09:20 */ public function sceneAdd() { return $this->only(['notice_id','problem_description','content_description','demand_description']); } /** * @notes 编辑场景 * @return SupervisionNoticeProblemValidate * @author likeadmin * @date 2024/03/01 09:20 */ public function sceneEdit() { return $this->only(['id','notice_id','problem_description','content_description','demand_description']); } /** * @notes 删除场景 * @return SupervisionNoticeProblemValidate * @author likeadmin * @date 2024/03/01 09:20 */ public function sceneDelete() { return $this->only(['id']); } /** * @notes 详情场景 * @return SupervisionNoticeProblemValidate * @author likeadmin * @date 2024/03/01 09:20 */ public function sceneDetail() { return $this->only(['id']); } public function checkData($value): bool|string { $data = SupervisionNoticeProblem::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '数据不存在'; } return true; } public function checkNotice($value): bool|string { $data = SupervisionNotice::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '监理通知单信息不存在'; } return true; } }