正在显示
5 个修改的文件
包含
20 行增加
和
15 行删除
| @@ -265,7 +265,7 @@ class FileController | @@ -265,7 +265,7 @@ class FileController | ||
| 265 | //根据项目上传标识区分上传到cos/本地 | 265 | //根据项目上传标识区分上传到cos/本地 |
| 266 | $projectModel = new Project(); | 266 | $projectModel = new Project(); |
| 267 | $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); | 267 | $project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']); |
| 268 | - if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器 | 268 | + if ($project_info['project_location'] == 0) {//通项目时 上传到cos |
| 269 | $this->upload_location = 1;//1:上传到本地 | 269 | $this->upload_location = 1;//1:上传到本地 |
| 270 | } | 270 | } |
| 271 | } | 271 | } |
| @@ -372,7 +372,7 @@ class ImageController extends Controller | @@ -372,7 +372,7 @@ class ImageController extends Controller | ||
| 372 | //根据项目上传标识区分上传到cos/本地 | 372 | //根据项目上传标识区分上传到cos/本地 |
| 373 | $projectModel = new Project(); | 373 | $projectModel = new Project(); |
| 374 | $project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']); | 374 | $project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']); |
| 375 | - if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器 | 375 | + if ($project_info['project_location'] == 0) {//普通项目时 上传到cos |
| 376 | $this->upload_location = 1;//上传到cos | 376 | $this->upload_location = 1;//上传到cos |
| 377 | } | 377 | } |
| 378 | } | 378 | } |
| @@ -76,8 +76,8 @@ class ProjectLogic extends BaseLogic | @@ -76,8 +76,8 @@ class ProjectLogic extends BaseLogic | ||
| 76 | * @time :2023/8/30 11:57 | 76 | * @time :2023/8/30 11:57 |
| 77 | */ | 77 | */ |
| 78 | public function projectSave(){ | 78 | public function projectSave(){ |
| 79 | -// DB::beginTransaction(); | ||
| 80 | -// try { | 79 | + DB::beginTransaction(); |
| 80 | + try { | ||
| 81 | $this->createProjectData($this->param); | 81 | $this->createProjectData($this->param); |
| 82 | //保存项目信息 | 82 | //保存项目信息 |
| 83 | $this->saveProject($this->param); | 83 | $this->saveProject($this->param); |
| @@ -89,11 +89,11 @@ class ProjectLogic extends BaseLogic | @@ -89,11 +89,11 @@ class ProjectLogic extends BaseLogic | ||
| 89 | $this->saveProjectDeployOptimize($this->param['deploy_optimize']); | 89 | $this->saveProjectDeployOptimize($this->param['deploy_optimize']); |
| 90 | //保存售后信息 | 90 | //保存售后信息 |
| 91 | $this->saveProjectAfter($this->param['project_after']); | 91 | $this->saveProjectAfter($this->param['project_after']); |
| 92 | -// DB::commit(); | ||
| 93 | -// }catch (\Exception $e){ | ||
| 94 | -// DB::rollBack(); | ||
| 95 | -// $this->fail('error'); | ||
| 96 | -// } | 92 | + DB::commit(); |
| 93 | + }catch (\Exception $e){ | ||
| 94 | + DB::rollBack(); | ||
| 95 | + $this->fail('error'); | ||
| 96 | + } | ||
| 97 | return $this->success(); | 97 | return $this->success(); |
| 98 | } | 98 | } |
| 99 | 99 |
| @@ -45,9 +45,14 @@ class TaskLogic extends BaseLogic | @@ -45,9 +45,14 @@ class TaskLogic extends BaseLogic | ||
| 45 | $info['attachment'] = getFileUrl($info['attachment']); | 45 | $info['attachment'] = getFileUrl($info['attachment']); |
| 46 | $info['attachment_name'] = basename($info['attachment']); | 46 | $info['attachment_name'] = basename($info['attachment']); |
| 47 | } | 47 | } |
| 48 | - if(!empty($info['follow']['attachment'])){ | ||
| 49 | - $info['follow']['attachment'] = getFileUrl($info['follow']['attachment']); | ||
| 50 | - $info['follow']['attachment_name'] = basename($info['follow']['attachment']); | 48 | + if(!empty($info['follow'])){ |
| 49 | + foreach ($info['follow'] as $k => $v){ | ||
| 50 | + if(!empty($v['attachment'])){ | ||
| 51 | + $v['attachment'] = getFileUrl($v['attachment']); | ||
| 52 | + $v['attachment_name'] = basename($v['attachment']); | ||
| 53 | + } | ||
| 54 | + $info['follow'][$k] = $v; | ||
| 55 | + } | ||
| 51 | } | 56 | } |
| 52 | return $this->success($info); | 57 | return $this->success($info); |
| 53 | } | 58 | } |
| @@ -64,19 +64,19 @@ class ATemplateModuleLogic extends BaseLogic | @@ -64,19 +64,19 @@ class ATemplateModuleLogic extends BaseLogic | ||
| 64 | */ | 64 | */ |
| 65 | public function setAttribute($param){ | 65 | public function setAttribute($param){ |
| 66 | if(isset($param['image']) && !empty($param['image'])){ | 66 | if(isset($param['image']) && !empty($param['image'])){ |
| 67 | - $param['image'] = basename($param['image']); | 67 | + $param['image'] = str_replace_url($param['image']); |
| 68 | } | 68 | } |
| 69 | if(isset($param['images']) && !empty($param['images'])){ | 69 | if(isset($param['images']) && !empty($param['images'])){ |
| 70 | $arr_images = []; | 70 | $arr_images = []; |
| 71 | foreach ($param['images'] as $v){ | 71 | foreach ($param['images'] as $v){ |
| 72 | - $arr_images[] = basename($v); | 72 | + $arr_images[] = $v; |
| 73 | } | 73 | } |
| 74 | $param['images'] = implode(',',$arr_images); | 74 | $param['images'] = implode(',',$arr_images); |
| 75 | } | 75 | } |
| 76 | if(isset($param['video']) && !empty($param['video'])){ | 76 | if(isset($param['video']) && !empty($param['video'])){ |
| 77 | $arr_video = []; | 77 | $arr_video = []; |
| 78 | foreach ($param['video'] as $v){ | 78 | foreach ($param['video'] as $v){ |
| 79 | - $arr_video[] = basename($v); | 79 | + $arr_video[] = $v; |
| 80 | } | 80 | } |
| 81 | $param['video'] = implode(',',$arr_video); | 81 | $param['video'] = implode(',',$arr_video); |
| 82 | } | 82 | } |
-
请 注册 或 登录 后发表评论