作者 lyh

gx

... ... @@ -265,7 +265,7 @@ class FileController
//根据项目上传标识区分上传到cos/本地
$projectModel = new Project();
$project_info = $projectModel->read(['id' => $this->cache['project_id']], ['project_location']);
if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器
if ($project_info['project_location'] == 0) {//通项目时 上传到cos
$this->upload_location = 1;//1:上传到本地
}
}
... ...
... ... @@ -372,7 +372,7 @@ class ImageController extends Controller
//根据项目上传标识区分上传到cos/本地
$projectModel = new Project();
$project_info = $projectModel->read(['id'=>$this->cache['project_id']],['project_location']);
if ($project_info['project_location'] == 0) {//不为普通项目时 上传到本地服务器
if ($project_info['project_location'] == 0) {//普通项目时 上传到cos
$this->upload_location = 1;//上传到cos
}
}
... ...
... ... @@ -76,8 +76,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 11:57
*/
public function projectSave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$this->createProjectData($this->param);
//保存项目信息
$this->saveProject($this->param);
... ... @@ -89,11 +89,11 @@ class ProjectLogic extends BaseLogic
$this->saveProjectDeployOptimize($this->param['deploy_optimize']);
//保存售后信息
$this->saveProjectAfter($this->param['project_after']);
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('error');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('error');
}
return $this->success();
}
... ...
... ... @@ -45,9 +45,14 @@ class TaskLogic extends BaseLogic
$info['attachment'] = getFileUrl($info['attachment']);
$info['attachment_name'] = basename($info['attachment']);
}
if(!empty($info['follow']['attachment'])){
$info['follow']['attachment'] = getFileUrl($info['follow']['attachment']);
$info['follow']['attachment_name'] = basename($info['follow']['attachment']);
if(!empty($info['follow'])){
foreach ($info['follow'] as $k => $v){
if(!empty($v['attachment'])){
$v['attachment'] = getFileUrl($v['attachment']);
$v['attachment_name'] = basename($v['attachment']);
}
$info['follow'][$k] = $v;
}
}
return $this->success($info);
}
... ...
... ... @@ -64,19 +64,19 @@ class ATemplateModuleLogic extends BaseLogic
*/
public function setAttribute($param){
if(isset($param['image']) && !empty($param['image'])){
$param['image'] = basename($param['image']);
$param['image'] = str_replace_url($param['image']);
}
if(isset($param['images']) && !empty($param['images'])){
$arr_images = [];
foreach ($param['images'] as $v){
$arr_images[] = basename($v);
$arr_images[] = $v;
}
$param['images'] = implode(',',$arr_images);
}
if(isset($param['video']) && !empty($param['video'])){
$arr_video = [];
foreach ($param['video'] as $v){
$arr_video[] = basename($v);
$arr_video[] = $v;
}
$param['video'] = implode(',',$arr_video);
}
... ...