作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into lyh-server

@@ -169,14 +169,20 @@ class DomainSettingLogic extends BaseLogic @@ -169,14 +169,20 @@ class DomainSettingLogic extends BaseLogic
169 $this->fail('ftp信息填写未完整'); 169 $this->fail('ftp信息填写未完整');
170 } 170 }
171 171
172 - //获取自建站服务器详情  
173 - $record_info = $server_ip_model->read(['servers_id' => ServerConfig::SELF_SITE_ID], ['id', 'servers_id', 'total']);  
174 - if (!$record_info) {  
175 - $this->fail('解析记录不存在');  
176 - }  
177 -  
178 DB::beginTransaction(); 172 DB::beginTransaction();
179 try { 173 try {
  174 + //获取自建站服务器详情
  175 + $record_info = $server_ip_model->read(['servers_id' => ServerConfig::SELF_SITE_ID, 'ip' => $ftp['url']], ['id', 'servers_id', 'total']);
  176 + if (!$record_info) {
  177 + $record_id = $server_ip_model->addReturnId([
  178 + 'servers_id' => ServerConfig::SELF_SITE_ID,
  179 + 'ip' => $ftp['url'],
  180 + 'domain' => $domain,
  181 + 'remark' => $project_info['company']
  182 + ]);
  183 + $record_info = $server_ip_model->read(['id' => $record_id], ['id', 'servers_id', 'total']);
  184 + }
  185 +
180 //保存一条主域名记录 186 //保存一条主域名记录
181 $setting_info = $this->model->read(['project_id' => $this->user['project_id']]); 187 $setting_info = $this->model->read(['project_id' => $this->user['project_id']]);
182 if ($setting_info === false) { 188 if ($setting_info === false) {