修复 创建主机时候的问题
This commit is contained in:
parent
38a4d2d3e0
commit
03d4e7a6b8
@ -67,6 +67,11 @@ public function store(Request $request): Response|JsonResponse
|
|||||||
|
|
||||||
$host = (new Host)->create($data);
|
$host = (new Host)->create($data);
|
||||||
|
|
||||||
|
if (!$user->hasBalance($host->getRenewPrice())) {
|
||||||
|
$host->delete();
|
||||||
|
return $this->error('此用户余额不足,无法开计费项目。');
|
||||||
|
}
|
||||||
|
|
||||||
$host['host_id'] = $host->id;
|
$host['host_id'] = $host->id;
|
||||||
|
|
||||||
return $this->created($host);
|
return $this->created($host);
|
||||||
|
Loading…
Reference in New Issue
Block a user