|
...
|
...
|
@@ -9,7 +9,9 @@ |
|
|
|
|
|
|
|
namespace App\Console\Commands\LyhTest;
|
|
|
|
|
|
|
|
use App\Models\Project\AiBlogTask;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class lyhDemo extends Command
|
|
...
|
...
|
@@ -29,15 +31,11 @@ class lyhDemo extends Command |
|
|
|
protected $description = '更新路由';
|
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
$missingTaskIds = array_diff(
|
|
|
|
DB::table('article')->whereNotIn('project_id',['1,3','100020','100021','100064'])->pluck('task_id')->toArray(),
|
|
|
|
DB::table('gl_ai_blog_task')->pluck('task_id')->toArray()
|
|
|
|
);
|
|
|
|
echo '数据'.json_encode($missingTaskIds,true).PHP_EOL;
|
|
|
|
if (!empty($missingTaskIds)) {
|
|
|
|
DB::table('article')
|
|
|
|
->whereIn('task_id', $missingTaskIds)
|
|
|
|
->delete();
|
|
|
|
$aiBlogTaskModel = new AiBlogTask();
|
|
|
|
$lists = $aiBlogTaskModel->distinct()->pluck('project_id')->toArray();
|
|
|
|
foreach ($lists as $v){
|
|
|
|
echo '执行的项目id:'.$v;
|
|
|
|
Artisan::call('save_ai_blog_list', ['project_id' => $v]);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
...
|
...
|
|