// +---------------------------------------------------------------------- namespace app\jobs\notice; use app\services\order\StoreOrderServices; use crmeb\basic\BaseJobs; use crmeb\traits\QueueTrait; use think\facade\Log; /** * 小票打印 * Class PrintJob * @package app\jobs\notice */ class PrintJob extends BaseJobs { use QueueTrait; /** * 小票打印 * @param $id * @return bool|void */ public function doJob($id) { try { /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); $orderServices->orderPrintTicket((int)$id); return true; } catch (\Throwable $e) { Log::error('小票打印失败失败,失败原因:' . $e->getMessage()); } } }