作者 lyh

gx数据

@@ -68,12 +68,29 @@ class UpdateRoute extends Command @@ -68,12 +68,29 @@ class UpdateRoute extends Command
68 */ 68 */
69 public function handle() 69 public function handle()
70 { 70 {
71 - ProjectServer::useProject(1181);  
72 - return $this->setProductKeyword(); 71 + ProjectServer::useProject(4132);
  72 + return $this->product_action(4132);
73 DB::disconnect('custom_mysql'); 73 DB::disconnect('custom_mysql');
74 } 74 }
75 75
76 /** 76 /**
  77 + * @remark :执行所有产品的路由
  78 + * @name :product_action
  79 + * @author :lyh
  80 + * @method :post
  81 + * @time :2025/6/21 17:29
  82 + */
  83 + public function product_action($project_id){
  84 + $productModel = new Product();
  85 + $lists = $productModel->list([],'id',['id','title','route']);
  86 + foreach ($lists as $item){
  87 + $route = RouteMap::setRoute($item['title'],RouteMap::SOURCE_PRODUCT,$item['id'],$project_id);
  88 + $productModel->edit(['route'=>$route],['id'=>$item['id']]);
  89 + }
  90 + return true;
  91 + }
  92 +
  93 + /**
77 * @remark :查询 路由为空的关键词项目id 94 * @remark :查询 路由为空的关键词项目id
78 * @name :getNullRoute 95 * @name :getNullRoute
79 * @author :lyh 96 * @author :lyh
@@ -170,32 +187,6 @@ class UpdateRoute extends Command @@ -170,32 +187,6 @@ class UpdateRoute extends Command
170 return true; 187 return true;
171 } 188 }
172 189
173 -// $this->updateProjectOp();  
174 -// $projectModel = new Project();  
175 -// $lists = $projectModel->list(['delete_status'=>0],'id',['id']);  
176 -// foreach ($lists as $v){  
177 -// echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;  
178 -// ProjectServer::useProject($v['id']);  
179 -// $webSettingModel = new WebSetting();  
180 -// $settingInfo = $webSettingModel->read(['project_id'=>$v['id']]);  
181 -// if($settingInfo === false){  
182 -// echo date('Y-m-d H:i:s') . '当前项目的设置数据不存在:'.$v['id'] . PHP_EOL;  
183 -// //新增一条数据  
184 -// $data = [  
185 -// 'anchor_setting'=>'["3","4","5"]',  
186 -// 'anchor_is_enable'=>1,  
187 -// 'anchor_page_num'=>1,  
188 -// 'anchor_num'=>2,  
189 -// 'anchor_keyword_is_enable'=>1,  
190 -// 'project_id'=>$v['id']  
191 -// ];  
192 -// $webSettingModel->add($data);  
193 -// }  
194 -// DB::disconnect('custom_mysql');  
195 -// }  
196 -// echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;  
197 -// }  
198 -  
199 /** 190 /**
200 * @remark :更新产品 191 * @remark :更新产品
201 * @name :updateProduct 192 * @name :updateProduct