|
@@ -68,9 +68,7 @@ class UpdateRoute extends Command |
|
@@ -68,9 +68,7 @@ class UpdateRoute extends Command |
|
68
|
*/
|
68
|
*/
|
|
69
|
public function handle()
|
69
|
public function handle()
|
|
70
|
{
|
70
|
{
|
|
71
|
- ProjectServer::useProject(4132);
|
|
|
|
72
|
- return $this->product_action(4132);
|
|
|
|
73
|
- DB::disconnect('custom_mysql');
|
71
|
+ return $this->_action();
|
|
74
|
}
|
72
|
}
|
|
75
|
|
73
|
|
|
76
|
/**
|
74
|
/**
|
|
@@ -156,12 +154,17 @@ class UpdateRoute extends Command |
|
@@ -156,12 +154,17 @@ class UpdateRoute extends Command |
|
156
|
*/
|
154
|
*/
|
|
157
|
public function _action(){
|
155
|
public function _action(){
|
|
158
|
$projectModel = new Project();
|
156
|
$projectModel = new Project();
|
|
159
|
- $lists = $projectModel->list(['delete_status'=>0,'extend_type'=>0,'type'=>['!=',0]],'id',['id']);
|
|
|
|
160
|
- $keywordModel = new Keyword();
|
157
|
+ $lists = $projectModel->list(['id'=>['in',[4379,4380,4381,4382,4383]],'delete_status'=>0,'extend_type'=>0,'type'=>['!=',0]],'id',['id']);
|
|
161
|
foreach ($lists as $v){
|
158
|
foreach ($lists as $v){
|
|
162
|
ProjectServer::useProject($v['id']);
|
159
|
ProjectServer::useProject($v['id']);
|
|
163
|
echo date('Y-m-d H:i:s').' 执行的项目id:'.$v['id'].PHP_EOL;
|
160
|
echo date('Y-m-d H:i:s').' 执行的项目id:'.$v['id'].PHP_EOL;
|
|
164
|
- $keywordModel->edit(['type'=>1],['id'=>['!=',0]]);
|
161
|
+ $productModel = new Product();
|
|
|
|
162
|
+ $productModel->edit(['project_id'=>$v['id']],['id'=>['!=',0]]);
|
|
|
|
163
|
+ $productLists = $productModel->list([],'id',['id','title','route']);
|
|
|
|
164
|
+ foreach ($productLists as $item){
|
|
|
|
165
|
+ $route = RouteMap::setRoute($item['route'],'product',$item['id'],$v['id']);
|
|
|
|
166
|
+ $productModel->edit(['route'=>$route],['id'=>$item['id']]);
|
|
|
|
167
|
+ }
|
|
165
|
DB::disconnect('custom_mysql');
|
168
|
DB::disconnect('custom_mysql');
|
|
166
|
}
|
169
|
}
|
|
167
|
return true;
|
170
|
return true;
|