|
...
|
...
|
@@ -2,7 +2,8 @@ |
|
|
|
|
|
|
|
namespace App\Http\Logic\Aside;
|
|
|
|
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
|
|
|
|
use App\Http\Logic\Aside\User\ProjectLogic;
|
|
|
|
use App\Models\ServerConfig;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
...
|
...
|
@@ -28,18 +29,22 @@ class ServerConfigLogic extends BaseLogic |
|
|
|
try {
|
|
|
|
$res = parent::save($param);
|
|
|
|
|
|
|
|
$data = ['sql_id' => $res['id']];
|
|
|
|
$data['id'] = $param['project_id'];
|
|
|
|
if ($param['type'] == ServerConfig::TYPE_SERVER) {
|
|
|
|
$data = ['serve_id' => $res['id']];
|
|
|
|
$data['serve_id'] = $res['id'];
|
|
|
|
}else{
|
|
|
|
$data['mysql_id'] = $res['id'];
|
|
|
|
}
|
|
|
|
ProjectLogic::save($data);
|
|
|
|
|
|
|
|
//todo 创建数据库 初始化表
|
|
|
|
|
|
|
|
(new ProjectLogic)->save($data);
|
|
|
|
|
|
|
|
DB::commit();
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
DB::rollBack();
|
|
|
|
|
|
|
|
dump($e->getMessage());
|
|
|
|
$this->fail('保存失败');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|