orderId,'产品订单自动收货队列start'); $this->setRequest(); //判断是否已发货状态且到达自动收货时间 $ProductOrder = ProductOrder::findOne([ 'id' => $this->orderId, 'is_pay' => 1, 'is_send' => 1, // 已发货 'status' => 2 //待收货 ]); if (!$ProductOrder) { throw new \Exception('订单不存在'); } $ProductOrder->status = ProductOrderEnum::CONFIRM; $ProductOrder->received_time = time(); $ProductOrder->save(); ProductOrderLog::saveLog($this->orderId,'产品订单自动收货队列end'); } catch (\Exception $exception) { ProductOrderLog::saveLog($this->orderId,'产品订单自动收货队列异常:'.$exception->getMessage().'------'.$exception->getLine()); return; } } }