|
...
|
...
|
@@ -53,7 +53,7 @@ class UpdateRoute extends Command |
|
|
|
* @time :2023/11/20 15:13
|
|
|
|
*/
|
|
|
|
public function handle(){
|
|
|
|
ProjectServer::useProject(75);
|
|
|
|
ProjectServer::useProject(91);
|
|
|
|
$this->getProductKeyword();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
...
|
...
|
@@ -68,9 +68,16 @@ class UpdateRoute extends Command |
|
|
|
*/
|
|
|
|
public function getProductKeyword(){
|
|
|
|
$keywordModel = new Keyword();
|
|
|
|
$lists = $keywordModel->list(['route'=>'']);
|
|
|
|
$lists = $keywordModel->list(['status'=>1]);
|
|
|
|
if(!empty($lists)){
|
|
|
|
foreach ($lists as $v){
|
|
|
|
$tag = "-tag";
|
|
|
|
if (!substr($v['route'], -strlen($tag)) === $tag) {
|
|
|
|
$route = $v['route'].$tag;
|
|
|
|
// 如果不是以 '-tag' 结尾,则拼接上 '-tag'
|
|
|
|
$route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']);
|
|
|
|
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL;
|
|
|
|
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
...
|
...
|
|