作者 lyh

gx

@@ -132,8 +132,8 @@ class ProjectLogic extends BaseLogic @@ -132,8 +132,8 @@ class ProjectLogic extends BaseLogic
132 * @time :2023/8/30 11:57 132 * @time :2023/8/30 11:57
133 */ 133 */
134 public function projectSave(){ 134 public function projectSave(){
135 -// DB::beginTransaction();  
136 -// try { 135 + DB::beginTransaction();
  136 + try {
137 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 137 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
138 if($this->param['type'] == Project::TYPE_SEVEN){ 138 if($this->param['type'] == Project::TYPE_SEVEN){
139 //错误单直接返回,单独处理 139 //错误单直接返回,单独处理
@@ -151,20 +151,15 @@ class ProjectLogic extends BaseLogic @@ -151,20 +151,15 @@ class ProjectLogic extends BaseLogic
151 $this->saveProjectDeployOptimize($this->param['deploy_optimize']); 151 $this->saveProjectDeployOptimize($this->param['deploy_optimize']);
152 //保存售后信息 152 //保存售后信息
153 $this->saveProjectAfter($this->param['project_after']); 153 $this->saveProjectAfter($this->param['project_after']);
154 -  
155 $this->saveMinorLanguages($this->param['minor_language'] ?? []); 154 $this->saveMinorLanguages($this->param['minor_language'] ?? []);
156 - //保存询盘过滤配置  
157 -// $this->param['inquiry_filter_config']['project_id'] = $this->param['id'];  
158 -// $this->saveInquiryFilterConfig($this->param['inquiry_filter_config']);  
159 $this->syncImageFile($this->param['project_location'],$this->param['id']); 155 $this->syncImageFile($this->param['project_location'],$this->param['id']);
160 //创建站点 156 //创建站点
161 -// $this->createSite($this->param);  
162 (new SyncService())->projectAcceptAddress($this->param['id']); 157 (new SyncService())->projectAcceptAddress($this->param['id']);
163 -// }  
164 -// DB::commit();  
165 -// }catch (\Exception $e){  
166 -// DB::rollBack();  
167 -// $this->fail('保存失败,请联系管理员'); 158 + }
  159 + DB::commit();
  160 + }catch (\Exception $e){
  161 + DB::rollBack();
  162 + $this->fail('保存失败,请联系管理员');
168 } 163 }
169 164
170 return $this->success(); 165 return $this->success();
@@ -189,6 +184,9 @@ class ProjectLogic extends BaseLogic @@ -189,6 +184,9 @@ class ProjectLogic extends BaseLogic
189 $param['extend_type'] = Project::TYPE_FIVE; 184 $param['extend_type'] = Project::TYPE_FIVE;
190 unset($param['type']); 185 unset($param['type']);
191 } 186 }
  187 + if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
  188 + $param['uptime'] = date('Y-m-d H:i:s');
  189 + }
192 if(isset($param['level']) && !empty($param['level'])){ 190 if(isset($param['level']) && !empty($param['level'])){
193 $param['level'] = Arr::arrToSet($param['level']); 191 $param['level'] = Arr::arrToSet($param['level']);
194 } 192 }
@@ -228,6 +226,7 @@ class ProjectLogic extends BaseLogic @@ -228,6 +226,7 @@ class ProjectLogic extends BaseLogic
228 $param['is_visualization'] = json_encode($param['is_visualization']); 226 $param['is_visualization'] = json_encode($param['is_visualization']);
229 } 227 }
230 } 228 }
  229 +
231 $this->model->edit($param,['id'=>$param['id']]); 230 $this->model->edit($param,['id'=>$param['id']]);
232 Common::del_user_cache($this->model->getTable(),$param['id']); 231 Common::del_user_cache($this->model->getTable(),$param['id']);
233 return $this->success(); 232 return $this->success();