Browse Source

fix: coupon type cannot display properly (#21)

pplulee 1 year ago
parent
commit
f2bbafd764
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Models/UserCoupon.php

+ 1 - 1
src/Models/UserCoupon.php

@@ -29,7 +29,7 @@ final class UserCoupon extends Model
      */
     public function type(): string
     {
-        return match (json_decode($this->content)) {
+        return match (json_decode($this->content)->type ?? null) {
             'percentage' => '百分比',
             'fixed' => '固定金额',
             default => '未知',