作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -47,6 +47,7 @@ use App\Services\ProjectServer; @@ -47,6 +47,7 @@ use App\Services\ProjectServer;
47 use App\Services\SyncService; 47 use App\Services\SyncService;
48 use App\Utils\LogUtils; 48 use App\Utils\LogUtils;
49 use Illuminate\Support\Facades\Cache; 49 use Illuminate\Support\Facades\Cache;
  50 +use Illuminate\Support\Facades\DB;
50 use Illuminate\Support\Facades\Http; 51 use Illuminate\Support\Facades\Http;
51 52
52 /** 53 /**
@@ -144,6 +145,8 @@ class ProjectLogic extends BaseLogic @@ -144,6 +145,8 @@ class ProjectLogic extends BaseLogic
144 * @time :2023/8/30 11:57 145 * @time :2023/8/30 11:57
145 */ 146 */
146 public function projectSave(){ 147 public function projectSave(){
  148 + DB::beginTransaction();
  149 + try {
147 if($this->param['type'] == Project::TYPE_SEVEN){ 150 if($this->param['type'] == Project::TYPE_SEVEN){
148 //错误单直接返回,单独处理 151 //错误单直接返回,单独处理
149 $this->setTypeSevenEdit($this->param); 152 $this->setTypeSevenEdit($this->param);
@@ -171,6 +174,11 @@ class ProjectLogic extends BaseLogic @@ -171,6 +174,11 @@ class ProjectLogic extends BaseLogic
171 //同步信息表 174 //同步信息表
172 (new SyncService())->projectAcceptAddress($this->param['id']); 175 (new SyncService())->projectAcceptAddress($this->param['id']);
173 } 176 }
  177 + DB::commit();
  178 + }catch (\Exception $e){
  179 + DB::rollBack();
  180 + $this->fail('保存失败,请联系管理员');
  181 + }
174 return $this->success(); 182 return $this->success();
175 } 183 }
176 184