害害害害害害害害害害
This commit is contained in:
parent
29b8e43a9d
commit
1d44b34b53
@ -25,18 +25,16 @@ public function store(Request $request) {
|
|||||||
'host_id' => 'nullable|sometimes|exists:hosts,id',
|
'host_id' => 'nullable|sometimes|exists:hosts,id',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$request = $request->all();
|
|
||||||
|
|
||||||
// module_id 和 host_id 必须有个要填写
|
// module_id 和 host_id 必须有个要填写
|
||||||
if (!$request['module_id'] ?? 0 && !$request['host_id'] ?? 0) {
|
if (!$request->module_id && !$request->host_id) {
|
||||||
return $this->error('module_id 和 host_id 至少要填写一个');
|
return $this->error('module_id 和 host_id 至少要填写一个');
|
||||||
}
|
}
|
||||||
|
|
||||||
$workOrder = WorkOrder::create([
|
$workOrder = WorkOrder::create([
|
||||||
'title' => $request['title'],
|
'title' => $request->title,
|
||||||
'content' => $request['content'],
|
'content' => $request->content,
|
||||||
'module_id' => $request['module_id'],
|
'module_id' => $request->module_id,
|
||||||
'host_id' => $request['host_id'],
|
'host_id' => $request->host_id,
|
||||||
'status' => 'pending',
|
'status' => 'pending',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user