'require|checkData', 'unit_qualification_id' => 'require|checkUnitQualification', 'name' => 'require', 'get_date_one' => 'dateFormat:Y-m-d', 'effective_date_one' => 'dateFormat:Y-m-d', 'qualification_one_status' => 'in:0,1', 'get_date_two' => 'dateFormat:Y-m-d', 'effective_date_two' => 'dateFormat:Y-m-d', 'qualification_two_status' => 'in:0,1', 'annex' => 'checkAnnex', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'unit_qualification_id' => '参建单位资质id', 'name' => '设备名称', 'qualification_name_one' => '资质名称1', 'certification_body_one' => '认证机构1', 'qualification_number_one' => '资质编号1', 'get_date_one' => '发证日期1', 'effective_date_one' => '有效日期1', 'qualification_one_status' => '资质1状态', 'qualification_name_two' => '资质名称2', 'certification_body_two' => '认证机构2', 'qualification_number_two' => '资质编号2', 'get_date_two' => '发证日期2', 'effective_date_two' => '有效日期2', 'qualification_two_status' => '资质2状态', 'remark' => '备注', 'create_user' => '创建人', ]; /** * @notes 添加场景 * @return SupervisionLargeEquipmentValidate * @author likeadmin * @date 2024/02/26 13:51 */ public function sceneAdd() { return $this->remove('id',true); } /** * @notes 编辑场景 * @return SupervisionLargeEquipmentValidate * @author likeadmin * @date 2024/02/26 13:51 */ public function sceneEdit() {} /** * @notes 删除场景 * @return SupervisionLargeEquipmentValidate * @author likeadmin * @date 2024/02/26 13:51 */ public function sceneDelete() { return $this->only(['id']); } /** * @notes 详情场景 * @return SupervisionLargeEquipmentValidate * @author likeadmin * @date 2024/02/26 13:51 */ public function sceneDetail() { return $this->only(['id']); } public function checkData($value): bool|string { $data = SupervisionLargeEquipment::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '数据不存在'; } return true; } public function checkUnitQualification($value): bool|string { $data = SupervisionParticipatingUnitsQualifications::where('id',$value)->findOrEmpty(); if($data->isEmpty()){ return '参建单位资质信息不存在'; } return true; } public function checkAnnex($value): bool|string { if(!empty($value) && $value != '' && !is_array($value)){ return '附件格式错误'; } return true; } }