|
@@ -55,8 +55,10 @@ class UpdateRoute extends Command |
|
@@ -55,8 +55,10 @@ class UpdateRoute extends Command |
|
55
|
public function handle(){
|
55
|
public function handle(){
|
|
56
|
// $projectModel = new Project();
|
56
|
// $projectModel = new Project();
|
|
57
|
// $list = $projectModel->list(['type'=>['in',[1,2,3,4]]]);
|
57
|
// $list = $projectModel->list(['type'=>['in',[1,2,3,4]]]);
|
|
|
|
58
|
+
|
|
58
|
// foreach ($list as $v){
|
59
|
// foreach ($list as $v){
|
|
59
|
ProjectServer::useProject(197);
|
60
|
ProjectServer::useProject(197);
|
|
|
|
61
|
+ $this->getProduct();
|
|
60
|
$this->setProductKeyword();
|
62
|
$this->setProductKeyword();
|
|
61
|
DB::disconnect('custom_mysql');
|
63
|
DB::disconnect('custom_mysql');
|
|
62
|
// }
|
64
|
// }
|
|
@@ -83,6 +85,24 @@ class UpdateRoute extends Command |
|
@@ -83,6 +85,24 @@ class UpdateRoute extends Command |
|
83
|
$routeModel = new RouteMap();
|
85
|
$routeModel = new RouteMap();
|
|
84
|
$routeModel->edit(['route'=>$route],['source'=>RouteMap::SOURCE_PRODUCT_KEYWORD,'source_id'=>$v['id']]);
|
86
|
$routeModel->edit(['route'=>$route],['source'=>RouteMap::SOURCE_PRODUCT_KEYWORD,'source_id'=>$v['id']]);
|
|
85
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
87
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
|
|
|
88
|
+ echo date('Y-m-d H:i:s') . 'end'.$v['id'] . PHP_EOL;
|
|
|
|
89
|
+ }
|
|
|
|
90
|
+ }
|
|
|
|
91
|
+ }
|
|
|
|
92
|
+ }
|
|
|
|
93
|
+
|
|
|
|
94
|
+ public function getProduct(){
|
|
|
|
95
|
+ $productModel = new Product();
|
|
|
|
96
|
+ $lists = $productModel->list(['status'=>1]);
|
|
|
|
97
|
+ if(!empty($lists)){
|
|
|
|
98
|
+ foreach ($lists as $v){
|
|
|
|
99
|
+ $tag = "-product";
|
|
|
|
100
|
+ if (!(substr($v['route'], -strlen($tag)) === $tag)) {
|
|
|
|
101
|
+ echo date('Y-m-d H:i:s') . '拼接'.$tag . PHP_EOL;
|
|
|
|
102
|
+ $route = $v['route'].$tag;
|
|
|
|
103
|
+ // 如果不是以 '-product' 结尾,则拼接上 '-product'
|
|
|
|
104
|
+ $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']);
|
|
|
|
105
|
+ $productModel->edit(['route'=>$route],['id'=>$v['id']]);
|
|
86
|
}
|
106
|
}
|
|
87
|
}
|
107
|
}
|
|
88
|
}
|
108
|
}
|
|
@@ -105,8 +125,7 @@ class UpdateRoute extends Command |
|
@@ -105,8 +125,7 @@ class UpdateRoute extends Command |
|
105
|
if (!(substr($v['route'], -strlen($tag)) === $tag)) {
|
125
|
if (!(substr($v['route'], -strlen($tag)) === $tag)) {
|
|
106
|
$route = $v['route'].$tag;
|
126
|
$route = $v['route'].$tag;
|
|
107
|
// 如果不是以 '-tag' 结尾,则拼接上 '-tag'
|
127
|
// 如果不是以 '-tag' 结尾,则拼接上 '-tag'
|
|
108
|
- $routeModel = new RouteMap();
|
|
|
|
109
|
- $routeModel->edit(['route'=>$route],['source'=>RouteMap::SOURCE_PRODUCT_KEYWORD,'source_id'=>$v['id']]);
|
128
|
+ $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
|
|
110
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
129
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
|
111
|
}
|
130
|
}
|
|
112
|
}else{
|
131
|
}else{
|
|
@@ -114,10 +133,11 @@ class UpdateRoute extends Command |
|
@@ -114,10 +133,11 @@ class UpdateRoute extends Command |
|
114
|
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
|
133
|
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
|
|
115
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
134
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
|
116
|
}
|
135
|
}
|
|
117
|
- echo date('Y-m-d H:i:s') . 'end :'.$route . PHP_EOL;
|
136
|
+ echo date('Y-m-d H:i:s') . 'end :' . PHP_EOL;
|
|
118
|
}
|
137
|
}
|
|
119
|
}
|
138
|
}
|
|
120
|
}
|
139
|
}
|
|
|
|
140
|
+
|
|
121
|
/**
|
141
|
/**
|
|
122
|
* @remark :删除路由通知C端
|
142
|
* @remark :删除路由通知C端
|
|
123
|
* @name :curlDelRoute
|
143
|
* @name :curlDelRoute
|