作者 lyh

gx

@@ -53,14 +53,10 @@ class UpdateRoute extends Command @@ -53,14 +53,10 @@ class UpdateRoute extends Command
53 * @time :2023/11/20 15:13 53 * @time :2023/11/20 15:13
54 */ 54 */
55 public function handle(){ 55 public function handle(){
56 - $projectModel = new Project();  
57 - $lists = $projectModel->list(['is_upgrade'=>0,'type'=>['!=',0]]);  
58 - foreach ($lists as $k => $v){  
59 - ProjectServer::useProject($v['id']);  
60 - $this->getProductKeyword($v['id']);  
61 - DB::disconnect('custom_mysql');  
62 - }  
63 - echo date('Y-m-d H:i:s') . ' end: 项目id为' . $v['id'] . PHP_EOL; 56 + ProjectServer::useProject(75);
  57 + $this->getProductKeyword();
  58 + DB::disconnect('custom_mysql');
  59 + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
64 } 60 }
65 61
66 /** 62 /**
@@ -70,12 +66,32 @@ class UpdateRoute extends Command @@ -70,12 +66,32 @@ class UpdateRoute extends Command
70 * @method :post 66 * @method :post
71 * @time :2023/12/8 11:13 67 * @time :2023/12/8 11:13
72 */ 68 */
73 - public function getProductKeyword($id){ 69 + public function getProductKeyword(){
74 $keywordModel = new Keyword(); 70 $keywordModel = new Keyword();
75 - $lists = $keywordModel->list(['route'=>['like','%-1-2-%']]); 71 + $lists = $keywordModel->list(['route'=>'']);
76 if(!empty($lists)){ 72 if(!empty($lists)){
77 - echo date('Y-m-d H:i:s') . ' 错误id:' . $id . PHP_EOL; 73 + foreach ($lists as $v){
  74 + echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL;
  75 + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $this->user['project_id']);
  76 + $this->curlDelRoute(['new_route'=>$route]);
  77 + $keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
  78 + echo date('Y-m-d H:i:s') . 'end :'.$route . PHP_EOL;
  79 + }
78 } 80 }
79 } 81 }
80 82
  83 + /**
  84 + * @remark :删除路由通知C端
  85 + * @name :curlDelRoute
  86 + * @author :lyh
  87 + * @method :post
  88 + * @time :2023/11/30 14:43
  89 + */
  90 + public function curlDelRoute($data){
  91 + $data['project_id'] = 75;
  92 + $str = http_build_query($data);
  93 + $url = $this->user['domain'].'api/delHtml/?'.$str;
  94 + curlGet($url);
  95 + return $this->success();
  96 + }
81 } 97 }