正在显示
1 个修改的文件
包含
6 行增加
和
12 行删除
| @@ -35,6 +35,7 @@ use App\Services\CosService; | @@ -35,6 +35,7 @@ use App\Services\CosService; | ||
| 35 | use App\Services\Geo\GeoService; | 35 | use App\Services\Geo\GeoService; |
| 36 | use App\Services\MidJourneyService; | 36 | use App\Services\MidJourneyService; |
| 37 | use App\Services\ProjectServer; | 37 | use App\Services\ProjectServer; |
| 38 | +use Hashids\Hashids; | ||
| 38 | use Illuminate\Console\Command; | 39 | use Illuminate\Console\Command; |
| 39 | use Illuminate\Support\Carbon; | 40 | use Illuminate\Support\Carbon; |
| 40 | use Illuminate\Support\Facades\DB; | 41 | use Illuminate\Support\Facades\DB; |
| @@ -56,7 +57,7 @@ class lyhDemo extends Command | @@ -56,7 +57,7 @@ class lyhDemo extends Command | ||
| 56 | protected $description = '更新路由'; | 57 | protected $description = '更新路由'; |
| 57 | 58 | ||
| 58 | public function handle(){ | 59 | public function handle(){ |
| 59 | - return $this->translate_action(); | 60 | + return $this->_actionRoute(); |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | public function _actionDa() | 63 | public function _actionDa() |
| @@ -113,21 +114,14 @@ class lyhDemo extends Command | @@ -113,21 +114,14 @@ class lyhDemo extends Command | ||
| 113 | */ | 114 | */ |
| 114 | public function _actionRoute(){ | 115 | public function _actionRoute(){ |
| 115 | $projectModel = new Project(); | 116 | $projectModel = new Project(); |
| 116 | - $lists = $projectModel->list(['delete_status' => 0,'is_ai_blog'=>1,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']); | 117 | + $lists = $projectModel->list(['type'=>['in',[1,2,3,4,6]]], 'id', ['id']); |
| 117 | $data = []; | 118 | $data = []; |
| 118 | foreach ($lists as $item){ | 119 | foreach ($lists as $item){ |
| 119 | echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | 120 | echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; |
| 120 | - ProjectServer::useProject($item['id']); | ||
| 121 | - $aiBlogModel = new AiBlog(); | ||
| 122 | - $info = $aiBlogModel->read(['text'=>['like','%href="blog/%']],['id']); | ||
| 123 | - if($info !== false){ | ||
| 124 | - echo '需要处理->项目id:'.$item['id'].PHP_EOL; | ||
| 125 | - $data[] = $item['id']; | ||
| 126 | - } | ||
| 127 | - echo 'end'; | ||
| 128 | - DB::disconnect('custom_mysql'); | 121 | + $data['post_id'] = mt_rand(100000, 999999).$item['id']; |
| 122 | + $projectModel->edit(['post_id'=>$data['post_id']],['id'=>$item['id']]); | ||
| 129 | } | 123 | } |
| 130 | - dd($data); | 124 | + return true; |
| 131 | } | 125 | } |
| 132 | 126 | ||
| 133 | public function _actionTemplateMain(){ | 127 | public function _actionTemplateMain(){ |
-
请 注册 或 登录 后发表评论