作者 赵彬吉
... ... @@ -433,8 +433,8 @@ class ProductController extends BaseController
* @time :2023/7/29 14:59
*/
public function copyProduct(ProductLogic $logic){
$rs = $logic->setCopyProduct();
$this->response('success',Code::SUCCESS,$rs);
$data = $logic->setCopyProduct();
$this->response('success',Code::SUCCESS,$data);
}
/**
... ...
... ... @@ -134,8 +134,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
if($this->param['type'] == Project::TYPE_SEVEN){
//错误单直接返回,单独处理
... ... @@ -158,11 +158,11 @@ class ProjectLogic extends BaseLogic
//创建站点
(new SyncService())->projectAcceptAddress($this->param['id']);
}
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('保存失败,请联系管理员');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败,请联系管理员');
}
return $this->success();
}
... ... @@ -229,7 +229,6 @@ class ProjectLogic extends BaseLogic
}
$param['upload_config'] = json_encode($param['upload_config'] ?? []);
$param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []);
unset($param['web_traffic_config']);
$this->model->edit($param,['id'=>$param['id']]);
Common::del_user_cache($this->model->getTable(),$param['id']);
return $this->success();
... ...
... ... @@ -50,7 +50,7 @@ class BlogLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('error');
$this->fail('系统错误,请联系管理员');
}
$this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route);
$this->curlDelRoute(['new_route'=>$route]);
... ...
... ... @@ -47,7 +47,6 @@ class ProductLogic extends BaseLogic
$this->param = $this->handleSaveParam($this->param);
try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1){
... ... @@ -442,7 +441,7 @@ class ProductLogic extends BaseLogic
$this->model->edit(['route'=>$route],['id'=>$save_id]);
//同步可视化装修数据
$this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
return $this->success();
return $this->success(['id'=>$save_id]);
}
/**
... ...
... ... @@ -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;
}
... ...