作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

... ... @@ -227,7 +227,8 @@ class ProjectLogic extends BaseLogic
$param['is_visualization'] = json_encode($param['is_visualization']);
}
}
$param['upload_config'] = json_encode($param['upload_config'] ?? []);
$param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []);
$this->model->edit($param,['id'=>$param['id']]);
Common::del_user_cache($this->model->getTable(),$param['id']);
return $this->success();
... ...
... ... @@ -137,8 +137,13 @@ class BlogLogic extends BaseLogic
DB::beginTransaction();
try {
foreach ($this->param['id'] as $id){
$this->delRoute($id);
$this->model->del(['id'=>$id]);
$info = $this->model->read(['id'=>$id],['id','status']);
if($info['status'] != 2){
$this->model->edit(['status'=>2],['id'=>$id]);
}else{
$this->delRoute($id);
$this->model->del(['id' => $id]);
}
}
DB::commit();
}catch (Exception $e){
... ...
... ... @@ -19,11 +19,6 @@ class Project extends Base
public static $projectLocationDangerous = 1; //危险项目
public static $storageTypeZero = 0; //默认腾讯压缩存储桶
public static $storageTypeOne = 1; //非压缩存储桶
public static $storageTypeZeroFileFix = "ecdn6.globalso.com"; //非压缩存储桶
public static $storageTypeOneFileFix = "ecdn6-nc.globalso.com"; //压缩存储桶
public static $projectLocationDangerousFileFix = "globalso-v6.s3.us-west-2.amazonaws.com"; //危险项目存储桶
//项目标识集合
public static $blockItems = "blockitems"; //html循环项父级标识
public static $blockAttrItems = "[blockitems]"; //html循环项父级属性标识
... ... @@ -335,6 +330,14 @@ class Project extends Base
return $value;
}
public function getWebTrafficConfigAttribute($value)
{
if($value){
$value = Arr::s2a($value);
}
return $value;
}
/**
* 根据域名获取项目信息
* @author zbj
... ...
... ... @@ -872,19 +872,21 @@ class CreatePageService{
{
$projectLocation = $project->project_location;
$storageType = $project->storage_type;
$cos = config('filesystems.disks.cos');
if ($projectLocation == Project::$projectLocationZero){
//普通项目
if ($storageType == Project::$storageTypeZero){
//压缩项目
$html = str_replace(Project::$storageTypeOneFileFix,Project::$storageTypeZeroFileFix,$html);
$html = str_replace($cos['cdn1'],$cos['cdn'],$html);
}else{
//非压缩项目
$html = str_replace(Project::$storageTypeZeroFileFix,Project::$storageTypeOneFileFix,$html);
$html = str_replace($cos['cdn'],$cos['cdn1'],$html);
}
}else{
$s3 = config('filesystems.disks.s3');
//危险项目
$html = str_replace(Project::$storageTypeOneFileFix,Project::$projectLocationDangerousFileFix,$html);
$html = str_replace(Project::$storageTypeZeroFileFix,Project::$projectLocationDangerousFileFix,$html);
$html = str_replace($cos['cdn1'],$s3['cdn'],$html);
$html = str_replace($cos['cdn'],$s3['cdn'],$html);
}
return $html;
}
... ...