作者 lyh
@@ -39,6 +39,7 @@ class ServersIpController extends BaseController @@ -39,6 +39,7 @@ class ServersIpController extends BaseController
39 } 39 }
40 $serversIpModel = new ServersIpModel(); 40 $serversIpModel = new ServersIpModel();
41 $this->map['total'] = ['<',$info['ip_total']]; 41 $this->map['total'] = ['<',$info['ip_total']];
  42 + $this->map['status'] = 0;
42 $data = $serversIpModel->list($this->map); 43 $data = $serversIpModel->list($this->map);
43 $this->response('success',Code::SUCCESS,$data); 44 $this->response('success',Code::SUCCESS,$data);
44 } 45 }
@@ -57,6 +58,7 @@ class ServersIpController extends BaseController @@ -57,6 +58,7 @@ class ServersIpController extends BaseController
57 'servers_id.required' => '服务器servers_id不能为空' 58 'servers_id.required' => '服务器servers_id不能为空'
58 ]); 59 ]);
59 $serversIpModel = new ServersIpModel(); 60 $serversIpModel = new ServersIpModel();
  61 + $this->map['status'] = 0;
60 $data = $serversIpModel->lists($this->map,$this->page,$this->row,$this->order); 62 $data = $serversIpModel->lists($this->map,$this->page,$this->row,$this->order);
61 $this->response('success',Code::SUCCESS,$data); 63 $this->response('success',Code::SUCCESS,$data);
62 } 64 }
@@ -61,7 +61,7 @@ class ProductController extends BaseController @@ -61,7 +61,7 @@ class ProductController extends BaseController
61 foreach ($lists['list'] as $k=>$v){ 61 foreach ($lists['list'] as $k=>$v){
62 $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);; 62 $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_PRODUCT,$v['id']);;
63 $v['category_id_text'] = $this->categoryName($v['id'],$cate_data); 63 $v['category_id_text'] = $this->categoryName($v['id'],$cate_data);
64 - $v['keyword_id_text'] = mb_substr($this->keywordName($v['keyword_id'],$key_data), 0, 20, 'UTF-8').'...'; 64 + $v['keyword_id_text'] = $this->keywordName($v['keyword_id'],$key_data);
65 $v['created_uid_text'] = $userModel->getName($v['created_uid']); 65 $v['created_uid_text'] = $userModel->getName($v['created_uid']);
66 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']); 66 $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_PRODUCT,BTemplate::IS_DETAIL,$template_id,$v['id']);
67 $v = $this->getHandleFileImage($v); 67 $v = $this->getHandleFileImage($v);
@@ -98,12 +98,12 @@ class ServersIpLogic extends BaseLogic @@ -98,12 +98,12 @@ class ServersIpLogic extends BaseLogic
98 * @time :2024/6/27 13:55 98 * @time :2024/6/27 13:55
99 */ 99 */
100 public function batchDelServersIp(){ 100 public function batchDelServersIp(){
101 - foreach ($this->param['ids'] as $v){  
102 - $info = $this->model->read(['id'=>$v['id']],['total']); 101 + foreach ($this->param['ids'] as $id){
  102 + $info = $this->model->read(['id'=>$id],['total']);
103 if($info['total'] != 0){ 103 if($info['total'] != 0){
104 continue; 104 continue;
105 } 105 }
106 - $this->model->edit(['status'=>1],['id'=>$v]); 106 + $this->model->edit(['status'=>1],['id'=>$id]);
107 } 107 }
108 return $this->success(); 108 return $this->success();
109 } 109 }
@@ -8,6 +8,7 @@ use App\Jobs\EditAmpDomainBt; @@ -8,6 +8,7 @@ use App\Jobs\EditAmpDomainBt;
8 use App\Jobs\EditCustomDomainBt; 8 use App\Jobs\EditCustomDomainBt;
9 use App\Jobs\EditDomainBt; 9 use App\Jobs\EditDomainBt;
10 use App\Models\Devops\ServerConfig; 10 use App\Models\Devops\ServerConfig;
  11 +use App\Models\Devops\Servers;
11 use App\Models\Devops\ServersIp; 12 use App\Models\Devops\ServersIp;
12 use App\Models\Domain\DomainInfo; 13 use App\Models\Domain\DomainInfo;
13 use App\Models\Project\CountryCustom; 14 use App\Models\Project\CountryCustom;
@@ -260,10 +261,13 @@ class DomainInfoLogic extends BaseLogic @@ -260,10 +261,13 @@ class DomainInfoLogic extends BaseLogic
260 $this->fail('获取项目数据失败'); 261 $this->fail('获取项目数据失败');
261 } 262 }
262 $serverIpModel = new ServersIp(); 263 $serverIpModel = new ServersIp();
263 - $server_info = $serverIpModel->read(['id'=>$project_info['serve_id']],['domain', 'ip']);  
264 - if($server_info === false){ 264 + $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
  265 + if($serversIpInfo === false){
265 $this->fail('获取服务器数据失败'); 266 $this->fail('获取服务器数据失败');
266 } 267 }
  268 + $serverModel = new Servers();
  269 + $serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
  270 + $server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
267 if($project_info['serve_id'] == 9){ 271 if($project_info['serve_id'] == 9){
268 $this->fail('请切换服务器,生成站点不能使用测试服务器'); 272 $this->fail('请切换服务器,生成站点不能使用测试服务器');
269 } 273 }
@@ -378,11 +382,13 @@ class DomainInfoLogic extends BaseLogic @@ -378,11 +382,13 @@ class DomainInfoLogic extends BaseLogic
378 if($this->param['is_create']){ 382 if($this->param['is_create']){
379 //需要创建站点 383 //需要创建站点
380 $serverIpModel = new ServersIp(); 384 $serverIpModel = new ServersIp();
381 - $server_info = $serverIpModel->read(['id'=>$project_info['serve_id']],['domain', 'ip']);  
382 - if($server_info === false){ 385 + $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
  386 + if($serversIpInfo === false){
383 $this->fail('获取服务器数据失败'); 387 $this->fail('获取服务器数据失败');
384 } 388 }
385 - 389 + $serverModel = new Servers();
  390 + $serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
  391 + $server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
386 //域名是否都已经解析 392 //域名是否都已经解析
387 if(strpos($this->param['custom_domain'],'//') === false){ 393 if(strpos($this->param['custom_domain'],'//') === false){
388 $this->param['custom_domain'] = '//'.$this->param['custom_domain']; 394 $this->param['custom_domain'] = '//'.$this->param['custom_domain'];
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Jobs; 3 namespace App\Jobs;
4 4
5 use App\Models\Devops\ServerConfig; 5 use App\Models\Devops\ServerConfig;
  6 +use App\Models\Devops\Servers;
6 use App\Models\Devops\ServersIp; 7 use App\Models\Devops\ServersIp;
7 use App\Models\Domain\DomainInfo; 8 use App\Models\Domain\DomainInfo;
8 use App\Models\Project\Project; 9 use App\Models\Project\Project;
@@ -54,10 +55,13 @@ class EditAmpDomainBt implements ShouldQueue @@ -54,10 +55,13 @@ class EditAmpDomainBt implements ShouldQueue
54 } 55 }
55 //获取服务器数据 56 //获取服务器数据
56 $serverIpModel = new ServersIp(); 57 $serverIpModel = new ServersIp();
57 - $server_info = $serverIpModel->read(['id'=>$project_info['serve_id']],['domain', 'ip']);  
58 - if ($server_info === false) { 58 + $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
  59 + if ($serversIpInfo === false) {
59 return $this->output($domain_info['domain'] . ':获取服务器数据失败'); 60 return $this->output($domain_info['domain'] . ':获取服务器数据失败');
60 } 61 }
  62 + $serverModel = new Servers();
  63 + $serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
  64 + $server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
61 //编辑amp站 65 //编辑amp站
62 $api_url_amp = 'http://' . $server_info['domain'] . '/api/createSiteAmp'; 66 $api_url_amp = 'http://' . $server_info['domain'] . '/api/createSiteAmp';
63 $api_param_amp = [ 67 $api_param_amp = [
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Jobs; 3 namespace App\Jobs;
4 4
5 use App\Models\Devops\ServerConfig; 5 use App\Models\Devops\ServerConfig;
  6 +use App\Models\Devops\Servers;
6 use App\Models\Devops\ServersIp; 7 use App\Models\Devops\ServersIp;
7 use App\Models\Project\CountryCustom; 8 use App\Models\Project\CountryCustom;
8 use App\Models\Project\Project; 9 use App\Models\Project\Project;
@@ -53,10 +54,13 @@ class EditCustomDomainBt implements ShouldQueue @@ -53,10 +54,13 @@ class EditCustomDomainBt implements ShouldQueue
53 } 54 }
54 //获取服务器数据 55 //获取服务器数据
55 $serverIpModel = new ServersIp(); 56 $serverIpModel = new ServersIp();
56 - $server_info = $serverIpModel->read(['id'=>$project_info['serve_id']],['domain', 'ip']);  
57 - if ($server_info === false) { 57 + $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
  58 + if ($serversIpInfo === false) {
58 return $this->output($domain_info['custom_domain'] . ':获取服务器数据失败'); 59 return $this->output($domain_info['custom_domain'] . ':获取服务器数据失败');
59 } 60 }
  61 + $serverModel = new Servers();
  62 + $serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
  63 + $server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
60 //编辑站点 64 //编辑站点
61 if ($domain_info['type'] == 2) { 65 if ($domain_info['type'] == 2) {
62 $api_url = 'http://' . $server_info['domain'] . '/api/setSsl'; 66 $api_url = 'http://' . $server_info['domain'] . '/api/setSsl';
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 namespace App\Jobs; 3 namespace App\Jobs;
4 4
5 use App\Models\Devops\ServerConfig; 5 use App\Models\Devops\ServerConfig;
  6 +use App\Models\Devops\Servers;
6 use App\Models\Devops\ServersIp; 7 use App\Models\Devops\ServersIp;
7 use App\Models\Domain\DomainInfo; 8 use App\Models\Domain\DomainInfo;
8 use App\Models\Project\Project; 9 use App\Models\Project\Project;
@@ -55,11 +56,13 @@ class EditDomainBt implements ShouldQueue @@ -55,11 +56,13 @@ class EditDomainBt implements ShouldQueue
55 56
56 //获取服务器数据 57 //获取服务器数据
57 $serverIpModel = new ServersIp(); 58 $serverIpModel = new ServersIp();
58 - $server_info = $serverIpModel->read(['id'=>$project_info['serve_id']],['domain', 'ip']);  
59 - if ($server_info === false) { 59 + $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
  60 + if ($serversIpInfo === false) {
60 return $this->output($domain_info['domain'] . ':获取服务器数据失败'); 61 return $this->output($domain_info['domain'] . ':获取服务器数据失败');
61 } 62 }
62 - 63 + $serverModel = new Servers();
  64 + $serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
  65 + $server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
63 //编辑主站 66 //编辑主站
64 if ($domain_info['type'] == 2) { 67 if ($domain_info['type'] == 2) {
65 $api_url = 'http://' . $server_info['domain'] . '/api/setSsl'; 68 $api_url = 'http://' . $server_info['domain'] . '/api/setSsl';