ContentTest.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Console\Commands\ContentManage;
  3. use http\Exception\RuntimeException;
  4. use Illuminate\Console\Command;
  5. use Illuminate\Support\Facades\DB;
  6. use Illuminate\Support\Facades\Redis;
  7. use Modules\Audience\Services\UserGroupService;
  8. use Modules\Common\Errors\Errors;
  9. use Modules\Common\Exceptions\CommonBusinessException;
  10. class ContentTest extends Command
  11. {
  12. /**
  13. * The name and signature of the console command.
  14. *
  15. * @var string
  16. */
  17. protected $signature = 'app:contenttest';
  18. /**
  19. * The console command description.
  20. *
  21. * @var string
  22. */
  23. protected $description = 'Command description';
  24. /**
  25. * Execute the console command.
  26. */
  27. public function handle(): void
  28. {
  29. $tags = [
  30. 'attention_hour' => '0-6',
  31. 'in_48_hour' => 1,
  32. 'interact_hour' => '0-6',
  33. 'last_watch_day' => '0-2',
  34. 'register_day' => '0-2',
  35. 'total_watch_day' => '0-2',
  36. 'charge_type' => 1,
  37. 'total_charge_money' => '1-1000',
  38. 'avg_charge_money' => '2-300',
  39. 'charge_num' => '1-1',
  40. 'remain_coin' => '0-1',
  41. 'last_charge_day' => '0-4',
  42. 'video_watch' => [1,2,3],
  43. 'video_charge' => [4,5]
  44. ];
  45. $sql = UserGroupService::getSQL($tags)->distinct()->count('a.uid');
  46. dump($sql);
  47. }
  48. }