order_id = $order_id; $this->shop_id = $shop_id; } /** * Execute the job. * */ public function handle() { $order_id = $this->order_id; var_dump('订单打印消息队列处理',$order_id); $shop_id = $this->shop_id; //获取商家打印机 $printer = ShopPrinter::where('shop_id',$shop_id)->where('is_del',0)->get(); foreach ($printer as $value){ $res = PrinterServer::creatServer()->sendPrints($value->{'brand_id'},$value->{'sn'},$order_id); var_dump($res); if ($res){ Order::where('id',$order_id)->where('shop_id',$shop_id)->update(['is_print'=>1]); } } return true; } }