Test.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Models\ShopPrinter;
  4. use App\Servers\JobServer;
  5. use App\Servers\printer\PrinterServer;
  6. use Carbon\Carbon;
  7. use Illuminate\Console\Command;
  8. class Test extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'test';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Command description';
  22. /**
  23. * Create a new command instance.
  24. *
  25. * @return void
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. }
  31. /**
  32. * Execute the console command.
  33. *
  34. * @return int
  35. */
  36. public function handle()
  37. {
  38. // $printer = ShopPrinter::where('shop_id',111)->where('is_del',0)->get();
  39. // foreach ($printer as $value){
  40. // $res = PrinterServer::creatServer()->sendPrints($value->{'brand_id'},$value->{'sn'},1);
  41. // var_dump($res);
  42. // }
  43. // dd(111);
  44. // 投递打印消息
  45. JobServer::creatServer()->shopOrderPrintJob(1,111);
  46. return 0;
  47. }
  48. }