作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -50,13 +50,13 @@ class BlogCategoryLogic extends BaseLogic @@ -50,13 +50,13 @@ class BlogCategoryLogic extends BaseLogic
50 //处理子集 50 //处理子集
51 $this->addProcessingSon($id); 51 $this->addProcessingSon($id);
52 } 52 }
53 - $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route);  
54 - $this->curlDelRoute(['new_route'=>$route]);  
55 DB::commit(); 53 DB::commit();
56 }catch (\Exception $e){ 54 }catch (\Exception $e){
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
@@ -42,13 +42,13 @@ class BlogLogic extends BaseLogic @@ -42,13 +42,13 @@ class BlogLogic extends BaseLogic
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->edit(['url'=>$route],['id'=>$id]); 43 $this->edit(['url'=>$route],['id'=>$id]);
44 } 44 }
45 - $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route);  
46 - $this->curlDelRoute(['new_route'=>$route]);  
47 DB::commit(); 45 DB::commit();
48 }catch (\Exception $e){ 46 }catch (\Exception $e){
49 DB::rollBack(); 47 DB::rollBack();
50 $this->fail('error'); 48 $this->fail('error');
51 } 49 }
  50 + $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route);
  51 + $this->curlDelRoute(['new_route'=>$route]);
52 return $this->success(); 52 return $this->success();
53 } 53 }
54 54
@@ -60,13 +60,13 @@ class NewsCategoryLogic extends BaseLogic @@ -60,13 +60,13 @@ class NewsCategoryLogic extends BaseLogic
60 //当父级分类拥有产品时,处理子集 60 //当父级分类拥有产品时,处理子集
61 $this->addProcessingSon($id); 61 $this->addProcessingSon($id);
62 } 62 }
63 - $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);  
64 - $this->curlDelRoute(['new_route'=>$route]);  
65 DB::commit(); 63 DB::commit();
66 }catch (\Exception $e){ 64 }catch (\Exception $e){
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
@@ -72,14 +72,14 @@ class NewsLogic extends BaseLogic @@ -72,14 +72,14 @@ class NewsLogic extends BaseLogic
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->edit(['url' => $route], ['id' => $id]); 73 $this->edit(['url' => $route], ['id' => $id]);
74 } 74 }
75 - $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);  
76 - $this->curlDelRoute(['new_route'=>$route]);  
77 //更新路由 75 //更新路由
78 DB::commit(); 76 DB::commit();
79 } catch (\Exception $e) { 77 } catch (\Exception $e) {
80 DB::rollBack(); 78 DB::rollBack();
81 $this->fail('系统错误,请联系管理员'); 79 $this->fail('系统错误,请联系管理员');
82 } 80 }
  81 + $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
  82 + $this->curlDelRoute(['new_route'=>$route]);
83 return $this->success(); 83 return $this->success();
84 } 84 }
85 85
@@ -126,8 +126,6 @@ class CategoryLogic extends BaseLogic @@ -126,8 +126,6 @@ class CategoryLogic extends BaseLogic
126 //处理子集 126 //处理子集
127 $this->addProcessingSon($id); 127 $this->addProcessingSon($id);
128 } 128 }
129 - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route);  
130 - $this->curlDelRoute(['new_route'=>$route]);  
131 //清除缓存 129 //清除缓存
132 Common::del_user_cache('product_category',$this->user['project_id']); 130 Common::del_user_cache('product_category',$this->user['project_id']);
133 DB::commit(); 131 DB::commit();
@@ -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
@@ -66,8 +66,6 @@ class KeywordLogic extends BaseLogic @@ -66,8 +66,6 @@ class KeywordLogic extends BaseLogic
66 $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']);
67 $this->model->edit(['route'=>$route],['id'=>$id]); 67 $this->model->edit(['route'=>$route],['id'=>$id]);
68 } 68 }
69 - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route);  
70 - $this->curlDelRoute(['new_route'=>$route]);  
71 //清除缓存 69 //清除缓存
72 Common::del_user_cache('product_keyword',$this->user['project_id']); 70 Common::del_user_cache('product_keyword',$this->user['project_id']);
73 DB::commit(); 71 DB::commit();
@@ -75,6 +73,8 @@ class KeywordLogic extends BaseLogic @@ -75,6 +73,8 @@ class KeywordLogic extends BaseLogic
75 DB::rollBack(); 73 DB::rollBack();
76 $this->fail('保存失败'); 74 $this->fail('保存失败');
77 } 75 }
  76 + $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_KEYWORD,$route);
  77 + $this->curlDelRoute(['new_route'=>$route]);
78 return $this->success(); 78 return $this->success();
79 } 79 }
80 80
@@ -44,7 +44,6 @@ class ProductLogic extends BaseLogic @@ -44,7 +44,6 @@ 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']);
@@ -57,17 +56,15 @@ class ProductLogic extends BaseLogic @@ -57,17 +56,15 @@ class ProductLogic extends BaseLogic
57 $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']);
58 $this->model->edit(['route'=>$route],['id'=>$id]); 57 $this->model->edit(['route'=>$route],['id'=>$id]);
59 } 58 }
60 - $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route);  
61 - $this->curlDelRoute(['new_route'=>$route]);  
62 //产品分类关联 59 //产品分类关联
63 CategoryRelated::saveRelated($id, $category_ids); 60 CategoryRelated::saveRelated($id, $category_ids);
64 //保存扩展字段 61 //保存扩展字段
65 $this->saveExtendInfo($id,$extend); 62 $this->saveExtendInfo($id,$extend);
66 - DB::connection('custom_mysql')->commit();  
67 }catch (\Exception $e){ 63 }catch (\Exception $e){
68 - DB::connection('custom_mysql')->rollBack();  
69 $this->fail('系统错误请联系管理员'); 64 $this->fail('系统错误请联系管理员');
70 } 65 }
  66 + $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route);
  67 + $this->curlDelRoute(['new_route'=>$route]);
71 return $this->success(); 68 return $this->success();
72 } 69 }
73 70