合并分支 'lyh-server' 到 'master'
gx 查看合并请求 !1553
正在显示
1 个修改的文件
包含
7 行增加
和
9 行删除
| @@ -9,7 +9,9 @@ | @@ -9,7 +9,9 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Console\Commands\LyhTest; | 10 | namespace App\Console\Commands\LyhTest; |
| 11 | 11 | ||
| 12 | +use App\Models\Project\AiBlogTask; | ||
| 12 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| 14 | +use Illuminate\Support\Facades\Artisan; | ||
| 13 | use Illuminate\Support\Facades\DB; | 15 | use Illuminate\Support\Facades\DB; |
| 14 | 16 | ||
| 15 | class lyhDemo extends Command | 17 | class lyhDemo extends Command |
| @@ -29,15 +31,11 @@ class lyhDemo extends Command | @@ -29,15 +31,11 @@ class lyhDemo extends Command | ||
| 29 | protected $description = '更新路由'; | 31 | protected $description = '更新路由'; |
| 30 | 32 | ||
| 31 | public function handle(){ | 33 | public function handle(){ |
| 32 | - $missingTaskIds = array_diff( | ||
| 33 | - DB::table('article')->whereNotIn('project_id',['1,3','100020','100021','100064'])->pluck('task_id')->toArray(), | ||
| 34 | - DB::table('gl_ai_blog_task')->pluck('task_id')->toArray() | ||
| 35 | - ); | ||
| 36 | - echo '数据'.json_encode($missingTaskIds,true).PHP_EOL; | ||
| 37 | - if (!empty($missingTaskIds)) { | ||
| 38 | - DB::table('article') | ||
| 39 | - ->whereIn('task_id', $missingTaskIds) | ||
| 40 | - ->delete(); | 34 | + $aiBlogTaskModel = new AiBlogTask(); |
| 35 | + $lists = $aiBlogTaskModel->distinct()->pluck('project_id')->toArray(); | ||
| 36 | + foreach ($lists as $v){ | ||
| 37 | + echo '执行的项目id:'.$v; | ||
| 38 | + Artisan::call('save_ai_blog_list', ['project_id' => $v]); | ||
| 41 | } | 39 | } |
| 42 | return true; | 40 | return true; |
| 43 | } | 41 | } |
-
请 注册 或 登录 后发表评论