|
...
|
...
|
@@ -163,7 +163,7 @@ class ProjectLogic extends BaseLogic |
|
|
|
$this->setTypeSevenEdit($this->param);
|
|
|
|
}else{
|
|
|
|
//初始化项目
|
|
|
|
$this->createProjectData($this->param);
|
|
|
|
$this->param = $this->createProjectData($this->param);
|
|
|
|
//双向绑定服务器,需放到保存项目的上方
|
|
|
|
$this->setServers($this->param['serve_id'],$this->param['id']);
|
|
|
|
//ai_blog
|
|
...
|
...
|
@@ -196,32 +196,6 @@ class ProjectLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :开启推荐供应商设置
|
|
|
|
* @name :isPurchaser
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/10 15:33
|
|
|
|
*/
|
|
|
|
public function isPurchaser($project_id){
|
|
|
|
if($this->param['type'] == Project::TYPE_TWO){
|
|
|
|
if(empty($this->param['uptime'])){
|
|
|
|
$this->param['deploy_build']['is_supplier'] = 1;
|
|
|
|
}else{
|
|
|
|
//获取项目的上线时间
|
|
|
|
$projectInfo = $this->model->read(['id'=>$project_id],['uptime']);
|
|
|
|
//查看上线时间是否大于3天
|
|
|
|
$threeDaysAgo = date('Y-m-d H:i:s', strtotime('-3 days'));
|
|
|
|
if($projectInfo['uptime'] > $threeDaysAgo){
|
|
|
|
//上线时间大于当前时间的3天钱,默认不允许关闭推荐供应商
|
|
|
|
$this->param['deploy_build']['is_supplier'] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :开启AI博客后
|
|
|
|
* @name :setAiBlog
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -350,8 +324,19 @@ class ProjectLogic extends BaseLogic |
|
|
|
* @time :2023/8/30 12:14
|
|
|
|
*/
|
|
|
|
public function saveProject($param){
|
|
|
|
if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
|
|
|
|
if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE))){
|
|
|
|
//自动开启推荐供应商
|
|
|
|
if(empty($param['uptime'])){
|
|
|
|
$this->param['deploy_build']['is_supplier'] = 1;
|
|
|
|
$param['uptime'] = date('Y-m-d H:i:s');
|
|
|
|
}else{
|
|
|
|
//查看上线时间是否大于3天
|
|
|
|
$threeDaysAgo = date('Y-m-d H:i:s', strtotime('-3 days'));
|
|
|
|
if($param['uptime'] > $threeDaysAgo){
|
|
|
|
//上线时间大于当前时间的3天钱,默认不允许关闭推荐供应商
|
|
|
|
$this->param['deploy_build']['is_supplier'] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($param['type'] == Project::TYPE_FIVE){
|
|
|
|
$param['extend_type'] = Project::TYPE_FIVE;
|
|
...
|
...
|
@@ -603,7 +588,7 @@ class ProjectLogic extends BaseLogic |
|
|
|
//改为异步
|
|
|
|
NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]);
|
|
|
|
}
|
|
|
|
return $this->success();
|
|
|
|
return $this->success($param);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|