<?php

namespace App\Console\Commands\ContentManage;

use http\Exception\RuntimeException;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Modules\Audience\Services\UserGroupService;
use Modules\Common\Errors\Errors;
use Modules\Common\Exceptions\CommonBusinessException;

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

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     */
    public function handle(): void
    {
        $tags = [
            'attention_hour' => '0-6',
            'in_48_hour' => 1,
            'interact_hour' => '0-6',
            'last_watch_day' => '0-2',
            'register_day' => '0-2',
            'total_watch_day' => '0-2',
            'charge_type' => 1,
            'total_charge_money' => '1-1000',
            'avg_charge_money' => '2-300',
            'charge_num' => '1-1',
            'remain_coin' => '0-1',
            'last_charge_day' => '0-4',
            'video_watch' => [1,2,3],
            'video_charge' => [4,5]
        ];

        $sql = UserGroupService::getSQL($tags)->distinct()->count('a.uid');
        dump($sql);
    }
}