正在显示
1 个修改的文件
包含
5 行增加
和
4 行删除
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | namespace App\Console\Commands; | 10 | namespace App\Console\Commands; |
| 11 | 11 | ||
| 12 | use App\Helper\Arr; | 12 | use App\Helper\Arr; |
| 13 | +use App\Helper\Translate; | ||
| 13 | use App\Models\CustomModule\CustomModuleCategory; | 14 | use App\Models\CustomModule\CustomModuleCategory; |
| 14 | use App\Models\CustomModule\CustomModuleContent; | 15 | use App\Models\CustomModule\CustomModuleContent; |
| 15 | use App\Models\Product\CategoryRelated; | 16 | use App\Models\Product\CategoryRelated; |
| @@ -54,16 +55,16 @@ class UpdateRoute extends Command | @@ -54,16 +55,16 @@ class UpdateRoute extends Command | ||
| 54 | */ | 55 | */ |
| 55 | public function handle(){ | 56 | public function handle(){ |
| 56 | $projectModel = new Project(); | 57 | $projectModel = new Project(); |
| 57 | - $list = $projectModel->list(['id'=>99]); | 58 | + $list = $projectModel->list(['id'=>632]); |
| 58 | foreach ($list as $v){ | 59 | foreach ($list as $v){ |
| 59 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 60 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 60 | ProjectServer::useProject($v['id']); | 61 | ProjectServer::useProject($v['id']); |
| 61 | // $this->getProduct(); | 62 | // $this->getProduct(); |
| 62 | -// $this->setProductKeyword(); | 63 | + $this->setProductKeyword(); |
| 63 | // $this->getRouteMap(); | 64 | // $this->getRouteMap(); |
| 64 | // $this->getProductCategory(); | 65 | // $this->getProductCategory(); |
| 65 | // $this->delRouteMap(); | 66 | // $this->delRouteMap(); |
| 66 | - $this->setCustomRoute($v['id']); | 67 | +// $this->setCustomRoute($v['id']); |
| 67 | DB::disconnect('custom_mysql'); | 68 | DB::disconnect('custom_mysql'); |
| 68 | } | 69 | } |
| 69 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 70 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -100,7 +101,7 @@ class UpdateRoute extends Command | @@ -100,7 +101,7 @@ class UpdateRoute extends Command | ||
| 100 | if(!empty($v['route'])){ | 101 | if(!empty($v['route'])){ |
| 101 | $tag = "-tag"; | 102 | $tag = "-tag"; |
| 102 | if (!(substr($v['route'], -strlen($tag)) === $tag)) { | 103 | if (!(substr($v['route'], -strlen($tag)) === $tag)) { |
| 103 | - $route = $v['route'].$tag; | 104 | + $route = Translate::tran($v['route'], 'en').$tag; |
| 104 | // 如果不是以 '-tag' 结尾,则拼接上 '-tag' | 105 | // 如果不是以 '-tag' 结尾,则拼接上 '-tag' |
| 105 | $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 106 | $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); |
| 106 | $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 107 | $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); |
-
请 注册 或 登录 后发表评论