Selaa lähdekoodia

优化:后台售后单显示退货物流信息

Yahoo 4 vuotta sitten
vanhempi
säilyke
fcd48f8590
2 muutettua tiedostoa jossa 11 lisäystä ja 2 poistoa
  1. 1 1
      app/api/model/OrderRefund.php
  2. 10 1
      app/common/model/OrderRefund.php

+ 1 - 1
app/api/model/OrderRefund.php

@@ -112,7 +112,7 @@ class OrderRefund extends OrderRefundModel
     public static function getDetail(int $orderRefundId, bool $isWith = false): ?OrderRefund
     {
         // 关联查询
-        $with = $isWith ? ['orderGoods' => ['image'], 'images.file', 'address'] : [];
+        $with = $isWith ? ['orderGoods' => ['image'], 'images.file', 'address', 'express'] : [];
         // 获取记录
         $detail = static::detail([
             'user_id' => UserService::getCurrentLoginUserId(),

+ 10 - 1
app/common/model/OrderRefund.php

@@ -81,6 +81,16 @@ class OrderRefund extends BaseModel
         return $this->hasOne('OrderRefundAddress');
     }
 
+    /**
+     * 获取器:用户发货时间
+     * @param $value
+     * @return false|string
+     */
+    public function getSendTimeAttr($value)
+    {
+        return format_time($value);
+    }
+
     /**
      * 售后单详情
      * @param array|int $where
@@ -91,5 +101,4 @@ class OrderRefund extends BaseModel
     {
         return static::get($where, $with);
     }
-
 }