作者 lyh

更新服务器管理

@@ -61,10 +61,6 @@ class InitProject extends Command @@ -61,10 +61,6 @@ class InitProject extends Command
61 $project_logic->createUser($project['mobile'],$project['id'],$project['lead_name']); 61 $project_logic->createUser($project['mobile'],$project['id'],$project['lead_name']);
62 } 62 }
63 $project_logic->createdRole($project['id']); 63 $project_logic->createdRole($project['id']);
64 - //更改服务器状态  
65 - if(!empty($project['serve_id'])){  
66 - $project_logic->updateServe($project['serve_id']);  
67 - }  
68 $item->status = NoticeLog::STATUS_SUCCESS; 64 $item->status = NoticeLog::STATUS_SUCCESS;
69 $item->save(); 65 $item->save();
70 echo 'success:' . $item['id'] . PHP_EOL; 66 echo 'success:' . $item['id'] . PHP_EOL;
@@ -53,6 +53,23 @@ class ServersIpController extends BaseController @@ -53,6 +53,23 @@ class ServersIpController extends BaseController
53 $this->response('success',Code::SUCCESS,$data); 53 $this->response('success',Code::SUCCESS,$data);
54 } 54 }
55 55
  56 + /**
  57 + * @remark :获取当前数据详情
  58 + * @name :info
  59 + * @author :lyh
  60 + * @method :post
  61 + * @time :2024/6/25 14:52
  62 + */
  63 + public function info(){
  64 + $this->request->validate([
  65 + 'id'=>'required'
  66 + ],[
  67 + 'id.required' => 'id不能为空'
  68 + ]);
  69 + $serversIpModel = new ServersIpModel();
  70 + $data = $serversIpModel->read(['id'=>$this->param['id']]);
  71 + $this->response('success',Code::SUCCESS,$data);
  72 + }
56 73
57 /** 74 /**
58 * @remark :保存数据 75 * @remark :保存数据
@@ -145,8 +145,8 @@ class ProjectLogic extends BaseLogic @@ -145,8 +145,8 @@ class ProjectLogic extends BaseLogic
145 * @time :2023/8/30 11:57 145 * @time :2023/8/30 11:57
146 */ 146 */
147 public function projectSave(){ 147 public function projectSave(){
148 -// DB::beginTransaction();  
149 -// try { 148 + DB::beginTransaction();
  149 + try {
150 if($this->param['type'] == Project::TYPE_SEVEN){ 150 if($this->param['type'] == Project::TYPE_SEVEN){
151 //错误单直接返回,单独处理 151 //错误单直接返回,单独处理
152 $this->setTypeSevenEdit($this->param); 152 $this->setTypeSevenEdit($this->param);
@@ -170,15 +170,26 @@ class ProjectLogic extends BaseLogic @@ -170,15 +170,26 @@ class ProjectLogic extends BaseLogic
170 //同步信息表 170 //同步信息表
171 (new SyncService())->projectAcceptAddress($this->param['id']); 171 (new SyncService())->projectAcceptAddress($this->param['id']);
172 } 172 }
173 -// DB::commit();  
174 -// }catch (\Exception $e){  
175 -// DB::rollBack();  
176 -// $this->fail('保存失败,请联系管理员');  
177 -// } 173 + DB::commit();
  174 + }catch (\Exception $e){
  175 + DB::rollBack();
  176 + $this->fail('保存失败,请联系管理员');
  177 + }
178 return $this->success(); 178 return $this->success();
179 } 179 }
180 180
181 /** 181 /**
  182 + * @remark :
  183 + * @name :setServers
  184 + * @author :lyh
  185 + * @method :post
  186 + * @time :2024/6/25 14:52
  187 + */
  188 + public function setServers(){
  189 +
  190 + }
  191 +
  192 + /**
182 * @remark :危险项目同步图片与文件 193 * @remark :危险项目同步图片与文件
183 * @name :syncImageFile 194 * @name :syncImageFile
184 * @author :lyh 195 * @author :lyh
@@ -200,8 +211,6 @@ class ProjectLogic extends BaseLogic @@ -200,8 +211,6 @@ class ProjectLogic extends BaseLogic
200 * @time :2023/8/30 12:14 211 * @time :2023/8/30 12:14
201 */ 212 */
202 public function saveProject($param){ 213 public function saveProject($param){
203 -// unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],  
204 -// $param['online_check'],$param['project_after'],$param['inquiry_filter_config'],$param['minor_languages']);  
205 if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){ 214 if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
206 $param['uptime'] = date('Y-m-d H:i:s'); 215 $param['uptime'] = date('Y-m-d H:i:s');
207 } 216 }
@@ -508,18 +517,7 @@ class ProjectLogic extends BaseLogic @@ -508,18 +517,7 @@ class ProjectLogic extends BaseLogic
508 } 517 }
509 518
510 519
511 - /**  
512 - * @remark :更新服务器为已使用  
513 - * @name :updateServe  
514 - * @author :lyh  
515 - * @method :post  
516 - * @time :2023/8/28 10:50  
517 - */  
518 - public function updateServe($serve_id){  
519 - $serverModel = new ServerConfig();  
520 - $serverModel->edit(['status'=>$serverModel::STATUS_ONE],['id'=>$serve_id]);  
521 - return $this->success();  
522 - } 520 +
523 521
524 522
525 523