Qrcode.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Models\Meta;
  4. use BlockMatrix\EosRpc\ChainFactory;
  5. use BlockMatrix\EosRpc\EosRpc;
  6. use BlockMatrix\EosRpc\WalletFactory;
  7. use Carbon\Carbon;
  8. use GuzzleHttp\Client;
  9. use Illuminate\Console\Command;
  10. use Illuminate\Support\Facades\Log;
  11. use Illuminate\Support\Facades\Storage;
  12. use Org\Multilinguals\Apollo\Client\ApolloClient;
  13. use ZanySoft\Zip\Zip;
  14. class Qrcode extends Command
  15. {
  16. /**
  17. * The name and signature of the console command.
  18. *
  19. * @var string
  20. */
  21. protected $signature = 'qrcode';
  22. /**
  23. * The console command description.
  24. *
  25. * @var string
  26. */
  27. protected $description = '重新生成二维码';
  28. /**
  29. * Create a new command instance.
  30. *
  31. * @return void
  32. */
  33. public function __construct()
  34. {
  35. parent::__construct();
  36. }
  37. /**
  38. * Execute the console command.
  39. *
  40. * @return mixed
  41. */
  42. public function handle()
  43. {
  44. $this->line('-----------start---------');
  45. $metas = Meta::all();
  46. foreach ($metas as $meta) {
  47. $this->line('------开始:' . $meta['patch_num']);
  48. Storage::put('chsy/qrcodes/'.$meta['patch_num'].'.png',\SimpleSoftwareIO\QrCode\Facades\QrCode::size(200)->generate("http://uptoyo.com/".$meta['id']));
  49. }
  50. $this->line('-----------end--------');
  51. }
  52. }