|
...
|
...
|
@@ -206,17 +206,19 @@ class ProjectLogic extends BaseLogic |
|
|
|
if($serversInfo['being_number'] >= $serversInfo['total']){
|
|
|
|
$this->fail('请选择其他服务器,当前服务器已满');
|
|
|
|
}
|
|
|
|
$project_arr = explode(',',trim($info['project_arr'],','));
|
|
|
|
$project_arr = [];
|
|
|
|
if(!empty(trim($info['project_arr'],','))){
|
|
|
|
$project_arr = explode(',',trim($info['project_arr'],','));
|
|
|
|
}
|
|
|
|
if(count($project_arr) >= $serversInfo['ip_total']){
|
|
|
|
$this->fail('请选择其他服务器,当前ip已满');
|
|
|
|
}
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($project_arr, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
if(!in_array($project_id,$project_arr) || empty($project_arr)){
|
|
|
|
array_push($project_arr,$project_id);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($project_arr, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$project_str = ','.implode(',',$project_arr).',';
|
|
|
|
// $serversIpModel->edit(['project_arr'=>$project_str,'total'=>count($project_arr)],['id'=>$servers_id]);
|
|
|
|
// $serversModel->where(['id'=>$info['servers_id']])->increment('being_number');
|
|
|
|
$serversIpModel->edit(['project_arr'=>$project_str,'total'=>count($project_arr)],['id'=>$servers_id]);
|
|
|
|
$serversModel->where(['id'=>$info['servers_id']])->increment('being_number');
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
}
|
...
|
...
|
|