Browse Source

增加退款信息访问器

dev
李可松 5 years ago
parent
commit
c9c4182fc0
  1. 12
      app/Models/Order.php

12
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);

Loading…
Cancel
Save