// +---------------------------------------------------------------------- namespace app\jobs\order; use app\services\order\StoreOrderDeliveryServices; use crmeb\basic\BaseJobs; use crmeb\traits\QueueTrait; use think\facade\Log; /** * 订单发货 * Class OrderDeliveryJob * @package app\jobs */ class OrderDeliveryJob extends BaseJobs { use QueueTrait; /** * 确认收货 * @param $orderInfo * @param $data * @param $type * @return bool */ public function doJob($orderInfo, $data, $type) { try { /** @var StoreOrderDeliveryServices $storeOrderDeliveryServices */ $storeOrderDeliveryServices = app()->make(StoreOrderDeliveryServices::class); $data['type'] = $type; $storeOrderDeliveryServices->doDelivery((int)$orderInfo['id'], $orderInfo, $data); } catch (\Throwable $e) { Log::error('收银台订单自动发货失败,原因:' . $e->getMessage()); } return true; } }