Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
4 个修改的文件
包含
22 行增加
和
11 行删除
| @@ -227,7 +227,8 @@ class ProjectLogic extends BaseLogic | @@ -227,7 +227,8 @@ class ProjectLogic extends BaseLogic | ||
| 227 | $param['is_visualization'] = json_encode($param['is_visualization']); | 227 | $param['is_visualization'] = json_encode($param['is_visualization']); |
| 228 | } | 228 | } |
| 229 | } | 229 | } |
| 230 | - | 230 | + $param['upload_config'] = json_encode($param['upload_config'] ?? []); |
| 231 | + $param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []); | ||
| 231 | $this->model->edit($param,['id'=>$param['id']]); | 232 | $this->model->edit($param,['id'=>$param['id']]); |
| 232 | Common::del_user_cache($this->model->getTable(),$param['id']); | 233 | Common::del_user_cache($this->model->getTable(),$param['id']); |
| 233 | return $this->success(); | 234 | return $this->success(); |
| @@ -137,8 +137,13 @@ class BlogLogic extends BaseLogic | @@ -137,8 +137,13 @@ class BlogLogic extends BaseLogic | ||
| 137 | DB::beginTransaction(); | 137 | DB::beginTransaction(); |
| 138 | try { | 138 | try { |
| 139 | foreach ($this->param['id'] as $id){ | 139 | foreach ($this->param['id'] as $id){ |
| 140 | + $info = $this->model->read(['id'=>$id],['id','status']); | ||
| 141 | + if($info['status'] != 2){ | ||
| 142 | + $this->model->edit(['status'=>2],['id'=>$id]); | ||
| 143 | + }else{ | ||
| 140 | $this->delRoute($id); | 144 | $this->delRoute($id); |
| 141 | - $this->model->del(['id'=>$id]); | 145 | + $this->model->del(['id' => $id]); |
| 146 | + } | ||
| 142 | } | 147 | } |
| 143 | DB::commit(); | 148 | DB::commit(); |
| 144 | }catch (Exception $e){ | 149 | }catch (Exception $e){ |
| @@ -19,11 +19,6 @@ class Project extends Base | @@ -19,11 +19,6 @@ class Project extends Base | ||
| 19 | public static $projectLocationDangerous = 1; //危险项目 | 19 | public static $projectLocationDangerous = 1; //危险项目 |
| 20 | public static $storageTypeZero = 0; //默认腾讯压缩存储桶 | 20 | public static $storageTypeZero = 0; //默认腾讯压缩存储桶 |
| 21 | public static $storageTypeOne = 1; //非压缩存储桶 | 21 | public static $storageTypeOne = 1; //非压缩存储桶 |
| 22 | - | ||
| 23 | - public static $storageTypeZeroFileFix = "ecdn6.globalso.com"; //非压缩存储桶 | ||
| 24 | - public static $storageTypeOneFileFix = "ecdn6-nc.globalso.com"; //压缩存储桶 | ||
| 25 | - public static $projectLocationDangerousFileFix = "globalso-v6.s3.us-west-2.amazonaws.com"; //危险项目存储桶 | ||
| 26 | - | ||
| 27 | //项目标识集合 | 22 | //项目标识集合 |
| 28 | public static $blockItems = "blockitems"; //html循环项父级标识 | 23 | public static $blockItems = "blockitems"; //html循环项父级标识 |
| 29 | public static $blockAttrItems = "[blockitems]"; //html循环项父级属性标识 | 24 | public static $blockAttrItems = "[blockitems]"; //html循环项父级属性标识 |
| @@ -335,6 +330,14 @@ class Project extends Base | @@ -335,6 +330,14 @@ class Project extends Base | ||
| 335 | return $value; | 330 | return $value; |
| 336 | } | 331 | } |
| 337 | 332 | ||
| 333 | + public function getWebTrafficConfigAttribute($value) | ||
| 334 | + { | ||
| 335 | + if($value){ | ||
| 336 | + $value = Arr::s2a($value); | ||
| 337 | + } | ||
| 338 | + return $value; | ||
| 339 | + } | ||
| 340 | + | ||
| 338 | /** | 341 | /** |
| 339 | * 根据域名获取项目信息 | 342 | * 根据域名获取项目信息 |
| 340 | * @author zbj | 343 | * @author zbj |
| @@ -872,19 +872,21 @@ class CreatePageService{ | @@ -872,19 +872,21 @@ class CreatePageService{ | ||
| 872 | { | 872 | { |
| 873 | $projectLocation = $project->project_location; | 873 | $projectLocation = $project->project_location; |
| 874 | $storageType = $project->storage_type; | 874 | $storageType = $project->storage_type; |
| 875 | + $cos = config('filesystems.disks.cos'); | ||
| 875 | if ($projectLocation == Project::$projectLocationZero){ | 876 | if ($projectLocation == Project::$projectLocationZero){ |
| 876 | //普通项目 | 877 | //普通项目 |
| 877 | if ($storageType == Project::$storageTypeZero){ | 878 | if ($storageType == Project::$storageTypeZero){ |
| 878 | //压缩项目 | 879 | //压缩项目 |
| 879 | - $html = str_replace(Project::$storageTypeOneFileFix,Project::$storageTypeZeroFileFix,$html); | 880 | + $html = str_replace($cos['cdn1'],$cos['cdn'],$html); |
| 880 | }else{ | 881 | }else{ |
| 881 | //非压缩项目 | 882 | //非压缩项目 |
| 882 | - $html = str_replace(Project::$storageTypeZeroFileFix,Project::$storageTypeOneFileFix,$html); | 883 | + $html = str_replace($cos['cdn'],$cos['cdn1'],$html); |
| 883 | } | 884 | } |
| 884 | }else{ | 885 | }else{ |
| 886 | + $s3 = config('filesystems.disks.s3'); | ||
| 885 | //危险项目 | 887 | //危险项目 |
| 886 | - $html = str_replace(Project::$storageTypeOneFileFix,Project::$projectLocationDangerousFileFix,$html); | ||
| 887 | - $html = str_replace(Project::$storageTypeZeroFileFix,Project::$projectLocationDangerousFileFix,$html); | 888 | + $html = str_replace($cos['cdn1'],$s3['cdn'],$html); |
| 889 | + $html = str_replace($cos['cdn'],$s3['cdn'],$html); | ||
| 888 | } | 890 | } |
| 889 | return $html; | 891 | return $html; |
| 890 | } | 892 | } |
-
请 注册 或 登录 后发表评论