Compare commits
2 Commits
97369445de
...
b3ef13654a
| Author | SHA1 | Date |
|---|---|---|
|
|
b3ef13654a | |
|
|
069ecb1e44 |
|
|
@ -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('修改成功');
|
||||||
}
|
}
|
||||||
|
|
@ -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('该结点有关联产量数据, 无法删除');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue