From c9c4182fc039ef8549b743455b2fd6f3ea9ac0f3 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 28 Jul 2021 18:48:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=80=E6=AC=BE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=BF=E9=97=AE=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/Order.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Models/Order.php b/app/Models/Order.php index 429788c..fc0d2e5 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -36,6 +36,18 @@ class Order extends BaseModel return $status_text[$this->status] ?? '未知'; } + //退款信息 + public function getRefundInfoAttribute($value) + { + $value = $value ? json_decode($value, true) : []; + if (is_array($value['pictures'])) { + foreach ($value['pictures'] as &$v) { + $v = $this->host . $v; + } + } + return $value ?? []; + } + public function product() { return $this->belongsTo(Product::class);