1
0
Эх сурвалжийг харах

fix: coupon type cannot display properly (#21)

pplulee 1 жил өмнө
parent
commit
f2bbafd764

+ 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 => '未知',