orderGoodModel->find($this->request->input('order_good_id')); if (empty($orderGoodInfo)) throw new ErrException('订单信息异常,请稍后再试或者联系客服'); $orderInfo = $this->orderModel->find($orderGoodInfo->order_id); if (empty($orderInfo)) throw new ErrException('订单不存在'); if ($orderInfo->status != OrderCode::FINISH) throw new ErrException('订单尚未完成,请稍候'); $skuInfo = $this->skuModel->find($orderGoodInfo->sku_id); if (empty($skuInfo)) throw new ErrException('该菜品信息不存在,请稍后再试'); $adminInfo = $this->adminUserModel->find($skuInfo->chef_id); $imageList = $this->getOssObjects(explode(',',$skuInfo->image_ids)); $imageUrl = array_column($imageList,'url'); $res = [ 'title' => $skuInfo->title, 'price' => $skuInfo->price, 'chef_id' => $skuInfo->chef_id, 'chef_name' => $adminInfo->chinese_name, 'image_url' => $imageUrl, ]; return $this->return->success('success',$res); } }