正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
| @@ -206,17 +206,19 @@ class ProjectLogic extends BaseLogic | @@ -206,17 +206,19 @@ class ProjectLogic extends BaseLogic | ||
| 206 | if($serversInfo['being_number'] >= $serversInfo['total']){ | 206 | if($serversInfo['being_number'] >= $serversInfo['total']){ |
| 207 | $this->fail('请选择其他服务器,当前服务器已满'); | 207 | $this->fail('请选择其他服务器,当前服务器已满'); |
| 208 | } | 208 | } |
| 209 | - $project_arr = explode(',',trim($info['project_arr'],',')); | 209 | + $project_arr = []; |
| 210 | + if(!empty(trim($info['project_arr'],','))){ | ||
| 211 | + $project_arr = explode(',',trim($info['project_arr'],',')); | ||
| 212 | + } | ||
| 210 | if(count($project_arr) >= $serversInfo['ip_total']){ | 213 | if(count($project_arr) >= $serversInfo['ip_total']){ |
| 211 | $this->fail('请选择其他服务器,当前ip已满'); | 214 | $this->fail('请选择其他服务器,当前ip已满'); |
| 212 | } | 215 | } |
| 213 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($project_arr, true) . PHP_EOL, FILE_APPEND); | ||
| 214 | if(!in_array($project_id,$project_arr) || empty($project_arr)){ | 216 | if(!in_array($project_id,$project_arr) || empty($project_arr)){ |
| 215 | array_push($project_arr,$project_id); | 217 | array_push($project_arr,$project_id); |
| 216 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($project_arr, true) . PHP_EOL, FILE_APPEND); | 218 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($project_arr, true) . PHP_EOL, FILE_APPEND); |
| 217 | $project_str = ','.implode(',',$project_arr).','; | 219 | $project_str = ','.implode(',',$project_arr).','; |
| 218 | -// $serversIpModel->edit(['project_arr'=>$project_str,'total'=>count($project_arr)],['id'=>$servers_id]); | ||
| 219 | -// $serversModel->where(['id'=>$info['servers_id']])->increment('being_number'); | 220 | + $serversIpModel->edit(['project_arr'=>$project_str,'total'=>count($project_arr)],['id'=>$servers_id]); |
| 221 | + $serversModel->where(['id'=>$info['servers_id']])->increment('being_number'); | ||
| 220 | } | 222 | } |
| 221 | return $this->success(); | 223 | return $this->success(); |
| 222 | } | 224 | } |
-
请 注册 或 登录 后发表评论