作者 lyh

gx

... ... @@ -2,6 +2,7 @@
namespace App\Http\Logic\Aside\Project;
use App\Models\Devops\ServerConfig;
use Illuminate\Support\Arr as SupArr;
use App\Helper\Arr;
use App\Helper\Common;
... ... @@ -228,6 +229,10 @@ class ProjectLogic extends BaseLogic
if(isset($param['serve_id']) && !empty($param['serve_id'])){
$this->updateServe($param['serve_id']);
}
//更改域名
if(isset($param['domain']) && !empty($param['domain'])){
$this->editDomainStatus($param['domain'],$param['id']);
}
}
return $this->success();
}
... ... @@ -258,8 +263,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/28 10:50
*/
public function updateServe($serve_id){
$domainModel = new DomainInfo();
$domainModel->edit(['status'=>$domainModel::STATUS_ONE],['id'=>$serve_id]);
$serverModel = new ServerConfig();
$serverModel->edit(['status'=>$serverModel::STATUS_ONE],['id'=>$serve_id]);
return $this->success();
}
... ... @@ -355,7 +360,21 @@ class ProjectLogic extends BaseLogic
}
/**
* @remark :修改域名时,同时更改其状态
* @name :domainStatus
* @author :lyh
* @method :post
* @time :2023/9/4 14:29
*/
public function editDomainStatus($domain,$project_id){
$domainModel = new DomainInfo();
//先清空上一次所绑定的域名
$domainModel->edit(['status'=>DomainInfo::STATUS_ZERO],['project_id'=>$project_id]);
//重新设置域名
$domainModel->edit(['status'=>DomainInfo::STATUS_ONE,'project_id'=>$project_id],['domain'=>$domain]);
return $this->success();
}
... ...
... ... @@ -15,7 +15,7 @@ use App\Models\Base;
class DomainInfo extends Base
{
const STATUS_ONE = 1;
const STATUS_ZERO = 0;
public $btAction = [
'create_site' => '/site?action=AddSite',
];
... ...