Browse Source

fix:订单详情状态字段改为模型

super-yimizi 2 months ago
parent
commit
9ca246775f
2 changed files with 3 additions and 3 deletions
  1. 2 2
      application/api/controller/Order.php
  2. 1 1
      application/common/model/Order.php

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

@@ -141,7 +141,7 @@ class Order extends Base
         if (empty($order)) {
             $this->error('未找到订单');
         }
-        $order->append(['order_status_text']);
+        //$order->append(['order_status_text']);
         $address = OrderService::getAddressInfo($orderId);
         $order->address = $address;
         // $order->append(['status_text']);
@@ -170,7 +170,7 @@ class Order extends Base
         $status   = OrderEnum::SHOW_TYPE_STATUS_MAP[$status];
         $list = OrderService::getOrderList($userId ,$param, $status);
         foreach ($list as $item) {
-            $item->append(['order_status_text']);
+           // $item->append(['order_status_text']);
             $field = 'id,order_sn,amount,goods_price,order_amount,express_name,express_no,order_goods,order_status_text,order_status';
             $item->visible(explode(',', $field));
         }

+ 1 - 1
application/common/model/Order.php

@@ -31,7 +31,7 @@ class Order extends Model
     protected $deleteTime = 'deletetime';
     // 追加属性
     protected $append = [
-    
+        'order_status_text',
     ];
     protected static $config = [];