Browse Source

fix:详情的地址

super-yimizi 2 months ago
parent
commit
a9b2cc7070

+ 2 - 0
application/api/controller/Order.php

@@ -141,6 +141,8 @@ class Order extends Base
         if (empty($order)) {
             $this->error('未找到订单');
         }
+        $address = OrderService::getAddressInfo($orderId);
+        $order->address = $address;
         // $order->append(['status_text']);
         // $order->hidden(explode(',', 'method,transactionid,updatetime,deletetime'));
         // $order->expiretime = $order->expiretime - time();

+ 8 - 1
application/common/Service/OrderService.php

@@ -529,7 +529,14 @@ class OrderService
     {
         return Order::with(['orderGoods'])
         ->where('id', $orderId)
-        ->where('user_id', $userId)->find();
+        ->where('user_id', $userId)
+        ->find();
+    }
+
+    // 查询地址信息
+    public static function getAddressInfo($orderId)
+    {
+        return OrderAddress::where('order_id', $orderId)->find();
     }
 
       

+ 8 - 1
application/common/service/OrderService.php

@@ -529,7 +529,14 @@ class OrderService
     {
         return Order::with(['orderGoods'])
         ->where('id', $orderId)
-        ->where('user_id', $userId)->find();
+        ->where('user_id', $userId)
+        ->find();
+    }
+
+    // 查询地址信息
+    public static function getAddressInfo($orderId)
+    {
+        return OrderAddress::where('order_id', $orderId)->find();
     }