作者 lyh

gx

@@ -53,9 +53,13 @@ class UpdateRoute extends Command @@ -53,9 +53,13 @@ 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 - ProjectServer::useProject(91);  
57 - $this->getProductKeyword();  
58 - DB::disconnect('custom_mysql'); 56 + $projectModel = new Project();
  57 + $list = $projectModel->list(['type'=>['in',[1,2,3,4]]]);
  58 + foreach ($list as $v){
  59 + ProjectServer::useProject($v['id']);
  60 + $this->getProductKeyword($v['id']);
  61 + DB::disconnect('custom_mysql');
  62 + }
59 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 63 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
60 } 64 }
61 65
@@ -66,7 +70,7 @@ class UpdateRoute extends Command @@ -66,7 +70,7 @@ class UpdateRoute extends Command
66 * @method :post 70 * @method :post
67 * @time :2023/12/8 11:13 71 * @time :2023/12/8 11:13
68 */ 72 */
69 - public function getProductKeyword(){ 73 + public function getProductKeyword($project_id){
70 $keywordModel = new Keyword(); 74 $keywordModel = new Keyword();
71 $lists = $keywordModel->list(['status'=>1]); 75 $lists = $keywordModel->list(['status'=>1]);
72 if(!empty($lists)){ 76 if(!empty($lists)){
@@ -77,7 +81,8 @@ class UpdateRoute extends Command @@ -77,7 +81,8 @@ class UpdateRoute extends Command
77 echo date('Y-m-d H:i:s') . '拼接'.$tag . PHP_EOL; 81 echo date('Y-m-d H:i:s') . '拼接'.$tag . PHP_EOL;
78 $route = $v['route'].$tag; 82 $route = $v['route'].$tag;
79 // 如果不是以 '-tag' 结尾,则拼接上 '-tag' 83 // 如果不是以 '-tag' 结尾,则拼接上 '-tag'
80 - $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], 91); 84 + $routeModel = new RouteMap();
  85 + $routeModel->edit(['route'=>$route],['source'=>RouteMap::SOURCE_PRODUCT_KEYWORD,'source_id'=>$v['id']]);
81 $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); 86 $keywordModel->edit(['route'=>$route],['id'=>$v['id']]);
82 } 87 }
83 } 88 }