作者 lyh

gx

@@ -97,8 +97,8 @@ class ProjectLogic extends BaseLogic @@ -97,8 +97,8 @@ class ProjectLogic extends BaseLogic
97 * @time :2023/8/30 11:57 97 * @time :2023/8/30 11:57
98 */ 98 */
99 public function projectSave(){ 99 public function projectSave(){
100 -// DB::beginTransaction();  
101 -// try { 100 + DB::beginTransaction();
  101 + try {
102 if($this->param['type'] == Project::TYPE_SEVEN){ 102 if($this->param['type'] == Project::TYPE_SEVEN){
103 //错误单直接返回,单独处理 103 //错误单直接返回,单独处理
104 $this->setTypeSevenEdit($this->param); 104 $this->setTypeSevenEdit($this->param);
@@ -115,15 +115,15 @@ class ProjectLogic extends BaseLogic @@ -115,15 +115,15 @@ class ProjectLogic extends BaseLogic
115 $this->saveProjectDeployOptimize($this->param['deploy_optimize']); 115 $this->saveProjectDeployOptimize($this->param['deploy_optimize']);
116 //保存售后信息 116 //保存售后信息
117 $this->saveProjectAfter($this->param['project_after']); 117 $this->saveProjectAfter($this->param['project_after']);
118 -// //创建站点  
119 -// $this->createSite($this->param); 118 + //创建站点
  119 + $this->createSite($this->param);
120 } 120 }
121 -// DB::commit();  
122 -// }catch (\Exception $e){  
123 -// DB::rollBack();  
124 -// $this->fail('请填写完整后再提交');  
125 -// }  
126 -// (new SyncService())->projectAcceptAddress($this->param['id']); 121 + DB::commit();
  122 + }catch (\Exception $e){
  123 + DB::rollBack();
  124 + $this->fail('请填写完整后再提交');
  125 + }
  126 + (new SyncService())->projectAcceptAddress($this->param['id']);
127 return $this->success(); 127 return $this->success();
128 } 128 }
129 129
@@ -562,6 +562,15 @@ class ProjectLogic extends BaseLogic @@ -562,6 +562,15 @@ class ProjectLogic extends BaseLogic
562 $paymentData['project_id'] = $project_id; 562 $paymentData['project_id'] = $project_id;
563 $paymentModel->insert($paymentData); 563 $paymentModel->insert($paymentData);
564 } 564 }
  565 + //复制售后表
  566 + $afterModel = new After();
  567 + $afterData = $afterModel::where('project_id', $this->param['project_id'])->first();
  568 + if(!empty($afterData)){
  569 + $afterData = $afterData->getAttributes();
  570 + unset($afterData['id']);
  571 + $afterData['project_id'] = $project_id;
  572 + $afterModel->insert($afterData);
  573 + }
565 //复制用户 574 //复制用户
566 $userModel = new UserModel(); 575 $userModel = new UserModel();
567 $userData = $userModel::where('project_id', $this->param['project_id'])->where('role_id',0)->first(); 576 $userData = $userModel::where('project_id', $this->param['project_id'])->where('role_id',0)->first();