默认值

This commit is contained in:
iVampireSP.com 2022-09-13 12:24:26 +08:00
parent 4e98504a13
commit 29b8e43a9d
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -28,7 +28,7 @@ public function store(Request $request) {
$request = $request->all();
// module_id 和 host_id 必须有个要填写
if (!$request['module_id'] && !$request['host_id']) {
if (!$request['module_id'] ?? 0 && !$request['host_id'] ?? 0) {
return $this->error('module_id 和 host_id 至少要填写一个');
}