'require|checkData', 'org_name' => 'require', 'filing_type' => 'require|checkFilingType', 'jgzcdz' => 'require', 'baksq' => 'require|dateFormat:Y-m-d', 'bajsq' => 'require|dateFormat:Y-m-d', 'basj' => 'dateFormat:Y-m-d', 'njsj' => 'dateFormat:Y-m-d', 'annex' => 'checkAnnex', ]; /** * 参数描述 * @var string[] */ protected $field = [ 'id' => 'id', 'org_name' => '机构名称', 'filing_type' => '备案类型', 'fddbr' => '法定代表人', 'telephone' => '联系电话', 'yyzzbh' => '营业执照编号', 'zzzsbh' => '资质证书编号', 'zzjgdmz' => '组织机构代码证', 'zgslxdh' => '总公司联系电话', 'zyxjlfw' => '主项监理范围', 'zjxjlfw' => '增项监理范围', 'bdbgdz' => '本地办公地址', 'bdgslxdh' => '本地公司联系电话', 'ryxx' => '人员信息', 'jgzcdz' => '机构注册地址', 'baksq' => '备案开始期', 'bajsq' => '备案结束期', 'basj' => '备案时间', 'jbr' => '经办人', 'njsj' => '年检时间', 'fzr' => '负责人', 'fzrsj' => '负责人手机', 'jsfzr' => '技术负责人', 'jsfzrsj' => '技术负责人手机', 'remark' => '备注', 'annex' => 'annex', ]; /** * @notes 添加场景 * @return MarketingBranchFilingValidate * @author likeadmin * @date 2024/04/05 10:00 */ public function sceneAdd() { return $this->remove('id', true); } /** * @notes 编辑场景 * @return MarketingBranchFilingValidate * @author likeadmin * @date 2024/04/05 10:00 */ public function sceneEdit() { } /** * @notes 删除场景 * @return MarketingBranchFilingValidate * @author likeadmin * @date 2024/04/05 10:00 */ public function sceneDelete() { return $this->only(['id'])->remove('id', 'checkData'); } /** * @notes 详情场景 * @return MarketingBranchFilingValidate * @author likeadmin * @date 2024/04/05 10:00 */ public function sceneDetail() { return $this->only(['id']); } public function checkData($value): bool|string { $data = MarketingBranchFiling::where('id', $value)->findOrEmpty(); return $data->isEmpty() ? '数据不存在' : true; } public function checkFilingType($value): bool|string { $dict = DictData::where('type_value', 'filing_type')->column('value'); if (!in_array($value, $dict)) { return '备案类型数据值无效'; } return true; } }