Merge remote-tracking branch 'origin/master' into akun
正在显示
8 个修改的文件
包含
31 行增加
和
117 行删除
| @@ -69,15 +69,16 @@ class OnlineCheckLogic extends BaseLogic | @@ -69,15 +69,16 @@ class OnlineCheckLogic extends BaseLogic | ||
| 69 | */ | 69 | */ |
| 70 | public function saveOnlineCheck(){ | 70 | public function saveOnlineCheck(){ |
| 71 | $info = $this->model->read(['project_id'=>$this->param['id']]); | 71 | $info = $this->model->read(['project_id'=>$this->param['id']]); |
| 72 | + $projectModel = new Project(); | ||
| 72 | if($info !== false){ | 73 | if($info !== false){ |
| 73 | - $this->fail('已提交,请勿重复提交'); | 74 | + $projectInfo = $projectModel->read(['id'=>$this->param['id']],['id','status']); |
| 75 | + if($projectInfo['status'] != $projectModel::STATUS_ONE){ | ||
| 76 | + $projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$projectInfo['id']]); | ||
| 77 | + } | ||
| 74 | }else{ | 78 | }else{ |
| 75 | if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){ | 79 | if(($this->param['optimist_mid'] == 0) || ($this->param['qa_mid'] == 0)){ |
| 76 | $this->fail('请先选择优化师和品控,在提交审核'); | 80 | $this->fail('请先选择优化师和品控,在提交审核'); |
| 77 | } | 81 | } |
| 78 | - $projectModel = new Project(); | ||
| 79 | - //提交审核修改状态为审核中 | ||
| 80 | - $projectModel->edit(['status'=>1],['id'=>$this->param['id']]); | ||
| 81 | //组装数据 | 82 | //组装数据 |
| 82 | $data = [ | 83 | $data = [ |
| 83 | 'project_id' => $this->param['id'], | 84 | 'project_id' => $this->param['id'], |
| @@ -86,9 +87,11 @@ class OnlineCheckLogic extends BaseLogic | @@ -86,9 +87,11 @@ class OnlineCheckLogic extends BaseLogic | ||
| 86 | 'qa_mid' => $this->param['qa_mid'], | 87 | 'qa_mid' => $this->param['qa_mid'], |
| 87 | 'created_at'=>date('Y-m-d H:i:s') | 88 | 'created_at'=>date('Y-m-d H:i:s') |
| 88 | ]; | 89 | ]; |
| 89 | - $rs = $this->model->add($data); | ||
| 90 | - if($rs === false){ | ||
| 91 | - $this->fail('error'); | 90 | + try { |
| 91 | + $projectModel->edit(['status'=>$projectModel::STATUS_ONE],['id'=>$this->param['id']]); | ||
| 92 | + $this->model->add($data); | ||
| 93 | + }catch (\Exception $e){ | ||
| 94 | + $this->fail('提交失败,请联系开发人员'); | ||
| 92 | } | 95 | } |
| 93 | } | 96 | } |
| 94 | return $this->success(); | 97 | return $this->success(); |
| @@ -33,7 +33,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -33,7 +33,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 33 | try { | 33 | try { |
| 34 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 34 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 35 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $this->param['id'], $this->user['project_id']); | 35 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $this->param['id'], $this->user['project_id']); |
| 36 | - $this->editCategoryRoute($this->param['id'], $this->param['alias']); | 36 | + $route = $this->param['alias']; |
| 37 | $this->editHandleCategory($this->param['id'],$this->param['pid']); | 37 | $this->editHandleCategory($this->param['id'],$this->param['pid']); |
| 38 | $this->param['operator_id'] = $this->user['id']; | 38 | $this->param['operator_id'] = $this->user['id']; |
| 39 | $this->edit($this->param,['id'=>$this->param['id']]); | 39 | $this->edit($this->param,['id'=>$this->param['id']]); |
| @@ -46,8 +46,6 @@ class BlogCategoryLogic extends BaseLogic | @@ -46,8 +46,6 @@ class BlogCategoryLogic extends BaseLogic | ||
| 46 | $this->param = $this->addParamProcessing($this->param); | 46 | $this->param = $this->addParamProcessing($this->param); |
| 47 | $id = $this->model->addReturnId($this->param); | 47 | $id = $this->model->addReturnId($this->param); |
| 48 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); | 48 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); |
| 49 | - $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); | ||
| 50 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 51 | $this->edit(['alias'=>$route],['id'=>$id]); | 49 | $this->edit(['alias'=>$route],['id'=>$id]); |
| 52 | //处理子集 | 50 | //处理子集 |
| 53 | $this->addProcessingSon($id); | 51 | $this->addProcessingSon($id); |
| @@ -57,6 +55,8 @@ class BlogCategoryLogic extends BaseLogic | @@ -57,6 +55,8 @@ class BlogCategoryLogic extends BaseLogic | ||
| 57 | DB::rollBack(); | 55 | DB::rollBack(); |
| 58 | $this->fail('系统错误,请联系管理'); | 56 | $this->fail('系统错误,请联系管理'); |
| 59 | } | 57 | } |
| 58 | + $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); | ||
| 59 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 60 | return $this->success(); | 60 | return $this->success(); |
| 61 | } | 61 | } |
| 62 | 62 | ||
| @@ -103,23 +103,6 @@ class BlogCategoryLogic extends BaseLogic | @@ -103,23 +103,6 @@ class BlogCategoryLogic extends BaseLogic | ||
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | /** | 105 | /** |
| 106 | - * @remark :编辑路由时生成路由记录 | ||
| 107 | - * @name :editCategoryRoute | ||
| 108 | - * @author :lyh | ||
| 109 | - * @method :post | ||
| 110 | - * @time :2023/9/7 10:51 | ||
| 111 | - */ | ||
| 112 | - public function editCategoryRoute($id,$route){ | ||
| 113 | - //生成一条删除路由记录 | ||
| 114 | - $info = $this->model->read(['id'=>$id],['id','alias']); | ||
| 115 | - if($info['alias'] != $route){ | ||
| 116 | - $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); | ||
| 117 | - $this->curlDelRoute(['route'=>$info['alias'],'new_route'=>$route]); | ||
| 118 | - } | ||
| 119 | - return true; | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - /** | ||
| 123 | * @name :详情 | 106 | * @name :详情 |
| 124 | * @return array | 107 | * @return array |
| 125 | * @author :liyuhang | 108 | * @author :liyuhang |
| @@ -35,13 +35,11 @@ class BlogLogic extends BaseLogic | @@ -35,13 +35,11 @@ class BlogLogic extends BaseLogic | ||
| 35 | $this->param = $this->paramProcessing($this->param); | 35 | $this->param = $this->paramProcessing($this->param); |
| 36 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 36 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 37 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $this->param['id'], $this->user['project_id']); | 37 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $this->param['id'], $this->user['project_id']); |
| 38 | - $this->editNewsRoute($this->param['id'],$this->param['url']); | 38 | + $route = $this->param['url']; |
| 39 | $this->edit($this->param,['id'=>$this->param['id']]); | 39 | $this->edit($this->param,['id'=>$this->param['id']]); |
| 40 | }else{ | 40 | }else{ |
| 41 | $id = $this->model->addReturnId($this->param); | 41 | $id = $this->model->addReturnId($this->param); |
| 42 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | 42 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 43 | - $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); | ||
| 44 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 45 | $this->edit(['url'=>$route],['id'=>$id]); | 43 | $this->edit(['url'=>$route],['id'=>$id]); |
| 46 | } | 44 | } |
| 47 | DB::commit(); | 45 | DB::commit(); |
| @@ -49,24 +47,9 @@ class BlogLogic extends BaseLogic | @@ -49,24 +47,9 @@ class BlogLogic extends BaseLogic | ||
| 49 | DB::rollBack(); | 47 | DB::rollBack(); |
| 50 | $this->fail('error'); | 48 | $this->fail('error'); |
| 51 | } | 49 | } |
| 52 | - return $this->success(); | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * @remark :查看是否编辑路由 | ||
| 57 | - * @name :editCategoryRoute | ||
| 58 | - * @author :lyh | ||
| 59 | - * @method :post | ||
| 60 | - * @time :2023/9/7 11:05 | ||
| 61 | - */ | ||
| 62 | - public function editNewsRoute($id,$route){ | ||
| 63 | - //生成一条删除路由记录 | ||
| 64 | - $info = $this->model->read(['id'=>$id],['id','url']); | ||
| 65 | - if($info['url'] != $route){ | ||
| 66 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); | 50 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); |
| 67 | - } | ||
| 68 | - $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); | ||
| 69 | - return true; | 51 | + $this->curlDelRoute(['new_route'=>$route]); |
| 52 | + return $this->success(); | ||
| 70 | } | 53 | } |
| 71 | 54 | ||
| 72 | /** | 55 | /** |
| @@ -45,7 +45,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -45,7 +45,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 45 | try { | 45 | try { |
| 46 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 46 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 47 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); | 47 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); |
| 48 | - $this->editCategoryRoute($this->param['id'],$this->param['alias']); | 48 | + $route = $this->param['alias']; |
| 49 | $this->editHandleCategory($this->param['id'],$this->param['pid']); | 49 | $this->editHandleCategory($this->param['id'],$this->param['pid']); |
| 50 | $this->param['operator_id'] = $this->user['id']; | 50 | $this->param['operator_id'] = $this->user['id']; |
| 51 | $this->edit($this->param,['id'=>$this->param['id']]); | 51 | $this->edit($this->param,['id'=>$this->param['id']]); |
| @@ -56,8 +56,6 @@ class NewsCategoryLogic extends BaseLogic | @@ -56,8 +56,6 @@ class NewsCategoryLogic extends BaseLogic | ||
| 56 | $this->param = $this->addParamProcessing($this->param); | 56 | $this->param = $this->addParamProcessing($this->param); |
| 57 | $id = $this->model->addReturnId($this->param); | 57 | $id = $this->model->addReturnId($this->param); |
| 58 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); | 58 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); |
| 59 | - $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); | ||
| 60 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 61 | $this->model->edit(['alias'=>$route],['id'=>$id]); | 59 | $this->model->edit(['alias'=>$route],['id'=>$id]); |
| 62 | //当父级分类拥有产品时,处理子集 | 60 | //当父级分类拥有产品时,处理子集 |
| 63 | $this->addProcessingSon($id); | 61 | $this->addProcessingSon($id); |
| @@ -67,6 +65,8 @@ class NewsCategoryLogic extends BaseLogic | @@ -67,6 +65,8 @@ class NewsCategoryLogic extends BaseLogic | ||
| 67 | DB::rollBack(); | 65 | DB::rollBack(); |
| 68 | $this->fail('系统错误,请联系管理员'); | 66 | $this->fail('系统错误,请联系管理员'); |
| 69 | } | 67 | } |
| 68 | + $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); | ||
| 69 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 70 | return $this->success(); | 70 | return $this->success(); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| @@ -112,23 +112,6 @@ class NewsCategoryLogic extends BaseLogic | @@ -112,23 +112,6 @@ class NewsCategoryLogic extends BaseLogic | ||
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | - /** | ||
| 116 | - * @remark :编辑路由时生成路由记录 | ||
| 117 | - * @name :editCategoryRoute | ||
| 118 | - * @author :lyh | ||
| 119 | - * @method :post | ||
| 120 | - * @time :2023/9/7 10:51 | ||
| 121 | - */ | ||
| 122 | - public function editCategoryRoute($id,$route){ | ||
| 123 | - //生成一条删除路由记录 | ||
| 124 | - $info = $this->model->read(['id'=>$id],['id','alias']); | ||
| 125 | - if($info['alias'] != $route){ | ||
| 126 | - $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); | ||
| 127 | - $this->curlDelRoute(['route'=>$info['alias'],'new_route'=>$route]); | ||
| 128 | - } | ||
| 129 | - return true; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | 115 | ||
| 133 | /** | 116 | /** |
| 134 | * @remark :修改状态 | 117 | * @remark :修改状态 |
| @@ -65,13 +65,11 @@ class NewsLogic extends BaseLogic | @@ -65,13 +65,11 @@ class NewsLogic extends BaseLogic | ||
| 65 | if (isset($this->param['id']) && !empty($this->param['id'])) { | 65 | if (isset($this->param['id']) && !empty($this->param['id'])) { |
| 66 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $this->param['id'], $this->user['project_id']); | 66 | $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $this->param['id'], $this->user['project_id']); |
| 67 | //是否更新路由 | 67 | //是否更新路由 |
| 68 | - $this->editNewsRoute($this->param['id'], $this->param['url']); | 68 | + $route = $this->param['url']; |
| 69 | $this->edit($this->param, ['id' => $this->param['id']]); | 69 | $this->edit($this->param, ['id' => $this->param['id']]); |
| 70 | } else { | 70 | } else { |
| 71 | $id = $this->model->addReturnId($this->param); | 71 | $id = $this->model->addReturnId($this->param); |
| 72 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 72 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 73 | - $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | ||
| 74 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 75 | $this->edit(['url' => $route], ['id' => $id]); | 73 | $this->edit(['url' => $route], ['id' => $id]); |
| 76 | } | 74 | } |
| 77 | //更新路由 | 75 | //更新路由 |
| @@ -80,25 +78,9 @@ class NewsLogic extends BaseLogic | @@ -80,25 +78,9 @@ class NewsLogic extends BaseLogic | ||
| 80 | DB::rollBack(); | 78 | DB::rollBack(); |
| 81 | $this->fail('系统错误,请联系管理员'); | 79 | $this->fail('系统错误,请联系管理员'); |
| 82 | } | 80 | } |
| 83 | - return $this->success(); | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - /** | ||
| 87 | - * @remark :查看是否编辑路由 | ||
| 88 | - * @name :editCategoryRoute | ||
| 89 | - * @author :lyh | ||
| 90 | - * @method :post | ||
| 91 | - * @time :2023/9/7 11:05 | ||
| 92 | - */ | ||
| 93 | - public function editNewsRoute($id, $route) | ||
| 94 | - { | ||
| 95 | - //生成一条删除路由记录 | ||
| 96 | - $info = $this->model->read(['id' => $id], ['id', 'url']); | ||
| 97 | - if ($info['url'] != $route) { | ||
| 98 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 81 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 99 | - } | ||
| 100 | - $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); | ||
| 101 | - return true; | 82 | + $this->curlDelRoute(['new_route'=>$route]); |
| 83 | + return $this->success(); | ||
| 102 | } | 84 | } |
| 103 | 85 | ||
| 104 | /** | 86 | /** |
| @@ -114,7 +114,7 @@ class CategoryLogic extends BaseLogic | @@ -114,7 +114,7 @@ class CategoryLogic extends BaseLogic | ||
| 114 | try { | 114 | try { |
| 115 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 115 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 116 | $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']); | 116 | $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']); |
| 117 | - $this->editCategoryRoute($this->param['id'],$this->param['route']); | 117 | + $route = $this->param['route']; |
| 118 | //处理子集 | 118 | //处理子集 |
| 119 | $this->editHandleCategory($this->param['id'],$this->param['pid']); | 119 | $this->editHandleCategory($this->param['id'],$this->param['pid']); |
| 120 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 120 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| @@ -122,8 +122,6 @@ class CategoryLogic extends BaseLogic | @@ -122,8 +122,6 @@ class CategoryLogic extends BaseLogic | ||
| 122 | $this->param['project_id'] = $this->user['project_id']; | 122 | $this->param['project_id'] = $this->user['project_id']; |
| 123 | $id = $this->model->addReturnId($this->param); | 123 | $id = $this->model->addReturnId($this->param); |
| 124 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']); | 124 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']); |
| 125 | - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); | ||
| 126 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 127 | $this->edit(['route'=>$route],['id'=>$id]); | 125 | $this->edit(['route'=>$route],['id'=>$id]); |
| 128 | //处理子集 | 126 | //处理子集 |
| 129 | $this->addProcessingSon($id); | 127 | $this->addProcessingSon($id); |
| @@ -135,6 +133,8 @@ class CategoryLogic extends BaseLogic | @@ -135,6 +133,8 @@ class CategoryLogic extends BaseLogic | ||
| 135 | DB::rollBack(); | 133 | DB::rollBack(); |
| 136 | $this->fail('系统错误,请联系管理员'); | 134 | $this->fail('系统错误,请联系管理员'); |
| 137 | } | 135 | } |
| 136 | + $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); | ||
| 137 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 138 | return $this->success(); | 138 | return $this->success(); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| @@ -223,23 +223,6 @@ class CategoryLogic extends BaseLogic | @@ -223,23 +223,6 @@ class CategoryLogic extends BaseLogic | ||
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | /** | 225 | /** |
| 226 | - * @remark :编辑路由时生成路由记录 | ||
| 227 | - * @name :editCategoryRoute | ||
| 228 | - * @author :lyh | ||
| 229 | - * @method :post | ||
| 230 | - * @time :2023/9/7 10:51 | ||
| 231 | - */ | ||
| 232 | - public function editCategoryRoute($id,$route){ | ||
| 233 | - //生成一条删除路由记录 | ||
| 234 | - $info = $this->model->read(['id'=>$id],['id','route']); | ||
| 235 | - if($info['route'] != $route){ | ||
| 236 | - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); | ||
| 237 | - $this->curlDelRoute(['route'=>$info['route'],'new_route'=>$route]); | ||
| 238 | - } | ||
| 239 | - return true; | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - /** | ||
| 243 | * @remark :删除 | 226 | * @remark :删除 |
| 244 | * @name :delete | 227 | * @name :delete |
| 245 | * @author :lyh | 228 | * @author :lyh |
| @@ -58,13 +58,12 @@ class KeywordLogic extends BaseLogic | @@ -58,13 +58,12 @@ class KeywordLogic extends BaseLogic | ||
| 58 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 58 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 59 | //TODO::不能修改路由 | 59 | //TODO::不能修改路由 |
| 60 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 60 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 61 | + $route = $this->param['route']; | ||
| 61 | }else{ | 62 | }else{ |
| 62 | $this->param = $this->addHandleParam($this->param); | 63 | $this->param = $this->addHandleParam($this->param); |
| 63 | $id = $this->model->insertGetId($this->param); | 64 | $id = $this->model->insertGetId($this->param); |
| 64 | //路由映射 | 65 | //路由映射 |
| 65 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); | 66 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); |
| 66 | - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route); | ||
| 67 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 68 | $this->model->edit(['route'=>$route],['id'=>$id]); | 67 | $this->model->edit(['route'=>$route],['id'=>$id]); |
| 69 | } | 68 | } |
| 70 | //清除缓存 | 69 | //清除缓存 |
| @@ -74,6 +73,8 @@ class KeywordLogic extends BaseLogic | @@ -74,6 +73,8 @@ class KeywordLogic extends BaseLogic | ||
| 74 | DB::rollBack(); | 73 | DB::rollBack(); |
| 75 | $this->fail('保存失败'); | 74 | $this->fail('保存失败'); |
| 76 | } | 75 | } |
| 76 | + $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route); | ||
| 77 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 77 | return $this->success(); | 78 | return $this->success(); |
| 78 | } | 79 | } |
| 79 | 80 |
| @@ -44,31 +44,27 @@ class ProductLogic extends BaseLogic | @@ -44,31 +44,27 @@ class ProductLogic extends BaseLogic | ||
| 44 | $category_ids = $this->handleCategory(); | 44 | $category_ids = $this->handleCategory(); |
| 45 | //处理其他字段 | 45 | //处理其他字段 |
| 46 | $this->param = $this->handleSaveParam($this->param); | 46 | $this->param = $this->handleSaveParam($this->param); |
| 47 | - DB::connection('custom_mysql')->beginTransaction(); | ||
| 48 | try { | 47 | try { |
| 49 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 48 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 50 | $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']); | 49 | $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']); |
| 51 | - //查看路由是否更新 | ||
| 52 | - $this->editProductRoute($this->param['id'],$this->param['route']); | 50 | + $route = $this->param['route']; |
| 53 | $this->model->edit($this->param,['id'=>$this->param['id']]); | 51 | $this->model->edit($this->param,['id'=>$this->param['id']]); |
| 54 | $id = $this->param['id']; | 52 | $id = $this->param['id']; |
| 55 | }else{ | 53 | }else{ |
| 56 | $this->param = $this->addHandleParam($this->param); | 54 | $this->param = $this->addHandleParam($this->param); |
| 57 | $id = $this->model->addReturnId($this->param); | 55 | $id = $this->model->addReturnId($this->param); |
| 58 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); | 56 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); |
| 59 | - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); | ||
| 60 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 61 | $this->model->edit(['route'=>$route],['id'=>$id]); | 57 | $this->model->edit(['route'=>$route],['id'=>$id]); |
| 62 | } | 58 | } |
| 63 | //产品分类关联 | 59 | //产品分类关联 |
| 64 | CategoryRelated::saveRelated($id, $category_ids); | 60 | CategoryRelated::saveRelated($id, $category_ids); |
| 65 | //保存扩展字段 | 61 | //保存扩展字段 |
| 66 | $this->saveExtendInfo($id,$extend); | 62 | $this->saveExtendInfo($id,$extend); |
| 67 | - DB::connection('custom_mysql')->commit(); | ||
| 68 | }catch (\Exception $e){ | 63 | }catch (\Exception $e){ |
| 69 | - DB::connection('custom_mysql')->rollBack(); | ||
| 70 | $this->fail('系统错误请联系管理员'); | 64 | $this->fail('系统错误请联系管理员'); |
| 71 | } | 65 | } |
| 66 | + $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); | ||
| 67 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 72 | return $this->success(); | 68 | return $this->success(); |
| 73 | } | 69 | } |
| 74 | 70 |
-
请 注册 或 登录 后发表评论