12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Console\Commands;
- use App\Libs\Utils;
- use Hashids;
- use Illuminate\Console\Command;
- class Test extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'test {bid}';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = '测试';
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $bid = $this->argument('bid');
- $enBid = Hashids::encode($bid);
- $enHotBids = array_map(function ($bid) {
- return Utils::getEncodeId($bid);
- }, [$bid]);
- dd($bid, $enBid, $enHotBids);
- }
- }
|