作者 lyh

更新服务器管理

... ... @@ -61,10 +61,6 @@ class InitProject extends Command
$project_logic->createUser($project['mobile'],$project['id'],$project['lead_name']);
}
$project_logic->createdRole($project['id']);
//更改服务器状态
if(!empty($project['serve_id'])){
$project_logic->updateServe($project['serve_id']);
}
$item->status = NoticeLog::STATUS_SUCCESS;
$item->save();
echo 'success:' . $item['id'] . PHP_EOL;
... ...
... ... @@ -53,6 +53,23 @@ class ServersIpController extends BaseController
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :获取当前数据详情
* @name :info
* @author :lyh
* @method :post
* @time :2024/6/25 14:52
*/
public function info(){
$this->request->validate([
'id'=>'required'
],[
'id.required' => 'id不能为空'
]);
$serversIpModel = new ServersIpModel();
$data = $serversIpModel->read(['id'=>$this->param['id']]);
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :保存数据
... ...
... ... @@ -145,8 +145,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
if($this->param['type'] == Project::TYPE_SEVEN){
//错误单直接返回,单独处理
$this->setTypeSevenEdit($this->param);
... ... @@ -170,15 +170,26 @@ class ProjectLogic extends BaseLogic
//同步信息表
(new SyncService())->projectAcceptAddress($this->param['id']);
}
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('保存失败,请联系管理员');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败,请联系管理员');
}
return $this->success();
}
/**
* @remark :
* @name :setServers
* @author :lyh
* @method :post
* @time :2024/6/25 14:52
*/
public function setServers(){
}
/**
* @remark :危险项目同步图片与文件
* @name :syncImageFile
* @author :lyh
... ... @@ -200,8 +211,6 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 12:14
*/
public function saveProject($param){
// unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],
// $param['online_check'],$param['project_after'],$param['inquiry_filter_config'],$param['minor_languages']);
if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
$param['uptime'] = date('Y-m-d H:i:s');
}
... ... @@ -508,18 +517,7 @@ class ProjectLogic extends BaseLogic
}
/**
* @remark :更新服务器为已使用
* @name :updateServe
* @author :lyh
* @method :post
* @time :2023/8/28 10:50
*/
public function updateServe($serve_id){
$serverModel = new ServerConfig();
$serverModel->edit(['status'=>$serverModel::STATUS_ONE],['id'=>$serve_id]);
return $this->success();
}
... ...