作者 lyh

gx

@@ -51,7 +51,7 @@ class InitProject extends Command @@ -51,7 +51,7 @@ class InitProject extends Command
51 $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get(); 51 $list = NoticeLog::where('type', NoticeLog::TYPE_INIT_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
52 foreach ($list as $item){ 52 foreach ($list as $item){
53 echo 'start:' . $item['id'] . PHP_EOL; 53 echo 'start:' . $item['id'] . PHP_EOL;
54 - try { 54 +// try {
55 $project = Project::find($item['data']['project_id']); 55 $project = Project::find($item['data']['project_id']);
56 $project_logic = new ProjectLogic(); 56 $project_logic = new ProjectLogic();
57 $projectInfo = $project_logic->getProjectInfo($project); 57 $projectInfo = $project_logic->getProjectInfo($project);
@@ -59,23 +59,23 @@ class InitProject extends Command @@ -59,23 +59,23 @@ class InitProject extends Command
59 if(!empty($projectInfo['mysql_id'])){ 59 if(!empty($projectInfo['mysql_id'])){
60 $project_logic->initializationMysql($project); 60 $project_logic->initializationMysql($project);
61 } 61 }
62 -// //初始账号  
63 -// if(!empty($projectInfo['mobile'])){  
64 -// $project_logic->createUser($projectInfo['mobile'],$projectInfo['id'],$projectInfo['lead_name']);  
65 -// }  
66 -// $project_logic->createdRole($projectInfo['id']);  
67 -// //更改服务器状态  
68 -// if(!empty($projectInfo['serve_id'])){  
69 -// $project_logic->updateServe($projectInfo['serve_id']);  
70 -// } 62 + //初始账号
  63 + if(!empty($projectInfo['mobile'])){
  64 + $project_logic->createUser($projectInfo['mobile'],$projectInfo['id'],$projectInfo['lead_name']);
  65 + }
  66 + $project_logic->createdRole($projectInfo['id']);
  67 + //更改服务器状态
  68 + if(!empty($projectInfo['serve_id'])){
  69 + $project_logic->updateServe($projectInfo['serve_id']);
  70 + }
71 $item->status = NoticeLog::STATUS_SUCCESS; 71 $item->status = NoticeLog::STATUS_SUCCESS;
72 $item->save(); 72 $item->save();
73 echo 'success:' . $item['id'] . PHP_EOL; 73 echo 'success:' . $item['id'] . PHP_EOL;
74 - }catch (\Exception $e){  
75 - echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;  
76 - errorLog('项目初始化失败', $item, $e);  
77 - $this->retry($item, $e->getMessage());  
78 - } 74 +// }catch (\Exception $e){
  75 +// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
  76 +// errorLog('项目初始化失败', $item, $e);
  77 +// $this->retry($item, $e->getMessage());
  78 +// }
79 } 79 }
80 sleep(2); 80 sleep(2);
81 } 81 }