正在显示
1 个修改的文件
包含
13 行增加
和
1 行删除
| @@ -11,6 +11,7 @@ namespace App\Console\Commands\Test; | @@ -11,6 +11,7 @@ namespace App\Console\Commands\Test; | ||
| 11 | 11 | ||
| 12 | use App\Helper\Arr; | 12 | use App\Helper\Arr; |
| 13 | use App\Helper\Translate; | 13 | use App\Helper\Translate; |
| 14 | +use App\Models\Blog\Blog; | ||
| 14 | use App\Models\CustomModule\CustomModuleCategory; | 15 | use App\Models\CustomModule\CustomModuleCategory; |
| 15 | use App\Models\Product\CategoryRelated; | 16 | use App\Models\Product\CategoryRelated; |
| 16 | use App\Models\Product\Keyword; | 17 | use App\Models\Product\Keyword; |
| @@ -60,7 +61,8 @@ class UpdateRoute extends Command | @@ -60,7 +61,8 @@ class UpdateRoute extends Command | ||
| 60 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 61 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 61 | ProjectServer::useProject($v['id']); | 62 | ProjectServer::useProject($v['id']); |
| 62 | // $this->getProduct(); | 63 | // $this->getProduct(); |
| 63 | - $this->setProductKeyword(); | 64 | +// $this->setProductKeyword(); |
| 65 | + $this->getBlog(); | ||
| 64 | DB::disconnect('custom_mysql'); | 66 | DB::disconnect('custom_mysql'); |
| 65 | } | 67 | } |
| 66 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 68 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -386,4 +388,14 @@ class UpdateRoute extends Command | @@ -386,4 +388,14 @@ class UpdateRoute extends Command | ||
| 386 | } | 388 | } |
| 387 | return true; | 389 | return true; |
| 388 | } | 390 | } |
| 391 | + | ||
| 392 | + public function getBlog(){ | ||
| 393 | + $blogModel = new Blog(); | ||
| 394 | + $lists = $blogModel->list(); | ||
| 395 | + foreach ($lists as $v){ | ||
| 396 | + $route = RouteMap::setRoute($v['name'], RouteMap::SOURCE_BLOG, $v['id'], 1462); | ||
| 397 | + $blogModel->edit(['url'=>$route],['id'=>$v['id']]); | ||
| 398 | + } | ||
| 399 | + return true; | ||
| 400 | + } | ||
| 389 | } | 401 | } |
-
请 注册 或 登录 后发表评论