|
@@ -65,7 +65,12 @@ class AssetGroupController extends Controller
|
|
|
public function destroy(string $id)
|
|
|
{
|
|
|
$group = AssetGroup::query()->findOrFail($id);
|
|
|
-
|
|
|
+ if(($group->assets)->isEmpty()){
|
|
|
+ $group->delete();
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ throw new \Exception("资产分组下还绑定了资产,不能删除。");
|
|
|
+ }
|
|
|
$group->delete();
|
|
|
|
|
|
return $this->noContent();
|