<?php

namespace App\Console\Commands\MeiTu;

use App\Jobs\PartnerBeautifyJob;
use App\Models\Partner\PartnerBeauty;
use Illuminate\Console\Command;

class BeautyCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'meitu:beauty';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '美图测试';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }


    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $partners = PartnerBeauty::where('is_beauty', 0)
            ->where('new_photo', '')
            ->pluck('id');

        foreach ($partners as $id) {
            PartnerBeautifyJob::dispatch($id)->onQueue("{meitu:beauty}");
        }
    }
}
