dev
vine_liutk 2022-11-09 12:14:12 +08:00
parent 97369445de
commit 069ecb1e44
1 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class CropController extends Controller
$input = $request->input(); $input = $request->input();
if ($input['is_end'] != $crop->is_end) { if ($input['is_end'] != $crop->is_end) {
if ($crop->is_end || Crop::where(['parent_id', $crop->id])->exists()) { if ($crop->is_end || Crop::where(['parent_id' => $crop->id])->exists()) {
return $this->error('无法修改结点状态'); return $this->error('无法修改结点状态');
} }
} }
@ -55,7 +55,7 @@ class CropController extends Controller
$input['path'] = ($parent?->path ?? '').$parent?->id.'-'; $input['path'] = ($parent?->path ?? '').$parent?->id.'-';
} }
$crop->update(array_merge($request->input())); $crop->update(array_merge($request->input(), $input));
return $this->success('修改成功'); return $this->success('修改成功');
} }