|
...
|
...
|
@@ -51,7 +51,7 @@ class InitProject extends Command |
|
|
|
$list = NoticeLog::where('type', NoticeLog::TYPE_INIT_PROJECT)->where('status', NoticeLog::STATUS_PENDING)->get();
|
|
|
|
foreach ($list as $item){
|
|
|
|
echo 'start:' . $item['id'] . PHP_EOL;
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
$project = Project::find($item['data']['project_id']);
|
|
|
|
$project_logic = new ProjectLogic();
|
|
|
|
$projectInfo = $project_logic->getProjectInfo($project);
|
|
...
|
...
|
@@ -59,23 +59,23 @@ class InitProject extends Command |
|
|
|
if(!empty($projectInfo['mysql_id'])){
|
|
|
|
$project_logic->initializationMysql($project);
|
|
|
|
}
|
|
|
|
// //初始账号
|
|
|
|
// if(!empty($projectInfo['mobile'])){
|
|
|
|
// $project_logic->createUser($projectInfo['mobile'],$projectInfo['id'],$projectInfo['lead_name']);
|
|
|
|
// }
|
|
|
|
// $project_logic->createdRole($projectInfo['id']);
|
|
|
|
// //更改服务器状态
|
|
|
|
// if(!empty($projectInfo['serve_id'])){
|
|
|
|
// $project_logic->updateServe($projectInfo['serve_id']);
|
|
|
|
// }
|
|
|
|
//初始账号
|
|
|
|
if(!empty($projectInfo['mobile'])){
|
|
|
|
$project_logic->createUser($projectInfo['mobile'],$projectInfo['id'],$projectInfo['lead_name']);
|
|
|
|
}
|
|
|
|
$project_logic->createdRole($projectInfo['id']);
|
|
|
|
//更改服务器状态
|
|
|
|
if(!empty($projectInfo['serve_id'])){
|
|
|
|
$project_logic->updateServe($projectInfo['serve_id']);
|
|
|
|
}
|
|
|
|
$item->status = NoticeLog::STATUS_SUCCESS;
|
|
|
|
$item->save();
|
|
|
|
echo 'success:' . $item['id'] . PHP_EOL;
|
|
|
|
}catch (\Exception $e){
|
|
|
|
echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
|
|
|
|
errorLog('项目初始化失败', $item, $e);
|
|
|
|
$this->retry($item, $e->getMessage());
|
|
|
|
}
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// echo 'error:' . $item['id'] . $e->getMessage() . PHP_EOL;
|
|
|
|
// errorLog('项目初始化失败', $item, $e);
|
|
|
|
// $this->retry($item, $e->getMessage());
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
sleep(2);
|
|
|
|
}
|
...
|
...
|
|