Test.php 754 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Libs\Utils;
  4. use Hashids;
  5. use Illuminate\Console\Command;
  6. class Test extends Command
  7. {
  8. /**
  9. * The name and signature of the console command.
  10. *
  11. * @var string
  12. */
  13. protected $signature = 'test {bid}';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = '测试';
  20. /**
  21. * Execute the console command.
  22. *
  23. * @return mixed
  24. */
  25. public function handle()
  26. {
  27. $bid = $this->argument('bid');
  28. $enBid = Hashids::encode($bid);
  29. $enHotBids = array_map(function ($bid) {
  30. return Utils::getEncodeId($bid);
  31. }, [$bid]);
  32. dd($bid, $enBid, $enHotBids);
  33. }
  34. }