|
...
|
...
|
@@ -10,6 +10,7 @@ |
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Helper\Translate;
|
|
|
|
use App\Models\CustomModule\CustomModuleCategory;
|
|
|
|
use App\Models\CustomModule\CustomModuleContent;
|
|
|
|
use App\Models\Product\CategoryRelated;
|
|
...
|
...
|
@@ -54,16 +55,16 @@ class UpdateRoute extends Command |
|
|
|
*/
|
|
|
|
public function handle(){
|
|
|
|
$projectModel = new Project();
|
|
|
|
$list = $projectModel->list(['id'=>99]);
|
|
|
|
$list = $projectModel->list(['id'=>632]);
|
|
|
|
foreach ($list as $v){
|
|
|
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
ProjectServer::useProject($v['id']);
|
|
|
|
// $this->getProduct();
|
|
|
|
// $this->setProductKeyword();
|
|
|
|
$this->setProductKeyword();
|
|
|
|
// $this->getRouteMap();
|
|
|
|
// $this->getProductCategory();
|
|
|
|
// $this->delRouteMap();
|
|
|
|
$this->setCustomRoute($v['id']);
|
|
|
|
// $this->setCustomRoute($v['id']);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
...
|
...
|
@@ -100,7 +101,7 @@ class UpdateRoute extends Command |
|
|
|
if(!empty($v['route'])){
|
|
|
|
$tag = "-tag";
|
|
|
|
if (!(substr($v['route'], -strlen($tag)) === $tag)) {
|
|
|
|
$route = $v['route'].$tag;
|
|
|
|
$route = Translate::tran($v['route'], 'en').$tag;
|
|
|
|
// 如果不是以 '-tag' 结尾,则拼接上 '-tag'
|
|
|
|
$route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']);
|
|
|
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
...
|
...
|
|