作者 lyh

gx

... ... @@ -53,14 +53,10 @@ class UpdateRoute extends Command
* @time :2023/11/20 15:13
*/
public function handle(){
$projectModel = new Project();
$lists = $projectModel->list(['is_upgrade'=>0,'type'=>['!=',0]]);
foreach ($lists as $k => $v){
ProjectServer::useProject($v['id']);
$this->getProductKeyword($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . ' end: 项目id为' . $v['id'] . PHP_EOL;
ProjectServer::useProject(75);
$this->getProductKeyword();
DB::disconnect('custom_mysql');
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
/**
... ... @@ -70,12 +66,32 @@ class UpdateRoute extends Command
* @method :post
* @time :2023/12/8 11:13
*/
public function getProductKeyword($id){
public function getProductKeyword(){
$keywordModel = new Keyword();
$lists = $keywordModel->list(['route'=>['like','%-1-2-%']]);
$lists = $keywordModel->list(['route'=>'']);
if(!empty($lists)){
echo date('Y-m-d H:i:s') . ' 错误id:' . $id . PHP_EOL;
foreach ($lists as $v){
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]);
$keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
echo date('Y-m-d H:i:s') . 'end :'.$route . PHP_EOL;
}
}
}
/**
* @remark :删除路由通知C端
* @name :curlDelRoute
* @author :lyh
* @method :post
* @time :2023/11/30 14:43
*/
public function curlDelRoute($data){
$data['project_id'] = 75;
$str = http_build_query($data);
$url = $this->user['domain'].'api/delHtml/?'.$str;
curlGet($url);
return $this->success();
}
}
... ...