Compare commits

..

No commits in common. "b3ef13654adb89d6e9ae200a79143b04e8c42415" and "97369445de755f94aa5e2d203495c73a2cda6107" have entirely different histories.

1 changed files with 3 additions and 3 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(), $input)); $crop->update(array_merge($request->input()));
return $this->success('修改成功'); return $this->success('修改成功');
} }
@ -67,7 +67,7 @@ class CropController extends Controller
return $this->error('该结点有关联产量数据, 无法删除'); return $this->error('该结点有关联产量数据, 无法删除');
} }
//如果有子节点,无法删除 //如果有子节点,无法删除
if (Crop::where(['parent_id' => $crop->id])->exists()) { if (Crop::where(['parent_id', $crop->id])->exists()) {
return $this->error('该结点有关联产量数据, 无法删除'); return $this->error('该结点有关联产量数据, 无法删除');
} }