正在显示
1 个修改的文件
包含
17 行增加
和
11 行删除
| @@ -42,16 +42,7 @@ class lyhDemo extends Command | @@ -42,16 +42,7 @@ class lyhDemo extends Command | ||
| 42 | protected $description = '更新路由'; | 42 | protected $description = '更新路由'; |
| 43 | 43 | ||
| 44 | public function handle(){ | 44 | public function handle(){ |
| 45 | - ProjectServer::useProject(3531); | ||
| 46 | - $newsModel = new News(); | ||
| 47 | - $rows = $newsModel->select('id', 'text')->get(); | ||
| 48 | - foreach ($rows as $row) { | ||
| 49 | - echo '执行数据id:'.$row->id.PHP_EOL; | ||
| 50 | - $newText = preg_replace('/<h1 class="t">.*?<\/h1>/is', '', $row->text); | ||
| 51 | - $newsModel->where('id', $row->id)->update(['text' => $newText]); | ||
| 52 | - } | ||
| 53 | - DB::disconnect('custom_mysql'); | ||
| 54 | - return true; | 45 | + return $this->_actionRoute(); |
| 55 | } | 46 | } |
| 56 | 47 | ||
| 57 | /** | 48 | /** |
| @@ -62,7 +53,22 @@ class lyhDemo extends Command | @@ -62,7 +53,22 @@ class lyhDemo extends Command | ||
| 62 | * @time :2025/7/22 15:14 | 53 | * @time :2025/7/22 15:14 |
| 63 | */ | 54 | */ |
| 64 | public function _actionRoute(){ | 55 | public function _actionRoute(){ |
| 65 | - | 56 | + $projectModel = new Project(); |
| 57 | + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']); | ||
| 58 | + $data = []; | ||
| 59 | + foreach ($lists as $item){ | ||
| 60 | + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | ||
| 61 | + ProjectServer::useProject($item['id']); | ||
| 62 | + $aiBlogModel = new AiBlog(); | ||
| 63 | + $info = $aiBlogModel->read(['route'=>null],['id']); | ||
| 64 | + if($info !== false){ | ||
| 65 | + echo '项目id:'.$item['id'].PHP_EOL; | ||
| 66 | + $data[] = $item['id']; | ||
| 67 | + } | ||
| 68 | + dd($data); | ||
| 69 | + echo 'end'; | ||
| 70 | + DB::disconnect('custom_mysql'); | ||
| 71 | + } | ||
| 66 | } | 72 | } |
| 67 | 73 | ||
| 68 | public function _actionTemplateMain(){ | 74 | public function _actionTemplateMain(){ |
-
请 注册 或 登录 后发表评论