|
...
|
...
|
@@ -75,14 +75,14 @@ class ServerConfigLogic extends BaseLogic |
|
|
|
if($project_list === false){
|
|
|
|
$this->fail('项目不存在或者已经删除');
|
|
|
|
}
|
|
|
|
// DB::beginTransaction();
|
|
|
|
// try {
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
//保存配置
|
|
|
|
$res = $this->model->save($this->param);
|
|
|
|
$res = $this->model->insertGetId($this->param);
|
|
|
|
if ($this->param['type'] == ServerConfig::TYPE_SERVER) {
|
|
|
|
$data['serve_id'] = $res['id'];
|
|
|
|
$data['serve_id'] = $res;
|
|
|
|
}else{
|
|
|
|
$data['mysql_id'] = $res['id'];
|
|
|
|
$data['mysql_id'] = $res;
|
|
|
|
}
|
|
|
|
$project->edit($data,['id'=>$this->param['project_id']]);
|
|
|
|
//初始化数据库
|
|
...
|
...
|
@@ -94,11 +94,11 @@ class ServerConfigLogic extends BaseLogic |
|
|
|
// //创建表
|
|
|
|
// ProjectServer::initTable($project);
|
|
|
|
// }
|
|
|
|
// DB::commit();
|
|
|
|
// } catch (\Exception $e) {
|
|
|
|
// DB::rollBack();
|
|
|
|
// $this->fail('保存失败');
|
|
|
|
// }
|
|
|
|
DB::commit();
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('保存失败');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|