ReceiptPrinterJob.php 680 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace common\queues;
  3. use Yii;
  4. use yii\base\BaseObject;
  5. use common\models\extend\Config;
  6. /**
  7. * 小票打印
  8. *
  9. * Class ReceiptPrinterJob
  10. * @package common\queues
  11. * @author jianyan74 <751393839@qq.com>
  12. */
  13. class ReceiptPrinterJob extends BaseObject implements \yii\queue\JobInterface
  14. {
  15. /**
  16. * @var Config
  17. */
  18. public $config;
  19. /**
  20. * @var array
  21. */
  22. public $data = [];
  23. /**
  24. * @param \yii\queue\Queue $queue
  25. * @return mixed|void
  26. * @throws \yii\base\InvalidConfigException
  27. */
  28. public function execute($queue)
  29. {
  30. Yii::$app->services->extendPrinter->receiptPrinter($this->config, $this->data);
  31. }
  32. }
粤ICP备19079148号