Qrcode.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. protected $save_dir = '';
  29. /**
  30. * Create a new command instance.
  31. *
  32. * @return void
  33. */
  34. public function __construct()
  35. {
  36. parent::__construct();
  37. }
  38. /**
  39. * Execute the console command.
  40. *
  41. * @return mixed
  42. */
  43. public function handle()
  44. {
  45. $this->line('-----------start---------');
  46. $metas = Meta::all();
  47. foreach ($metas as $meta) {
  48. $this->line('------开始:' . $meta['patch_num']);
  49. Storage::put('chsy/qrcodes/'.$meta['patch_num'].'.png',\SimpleSoftwareIO\QrCode\Facades\QrCode::size(200)->generate("http://uptoyo.com/".$meta['id']));
  50. }
  51. $this->line('-----------end--------');
  52. }
  53. }