feat(coupon): enhance theme compatibility by converting plan IDs to strings
Some checks failed
Docker Build and Publish / build (push) Has been cancelled

This commit is contained in:
xboard 2025-01-24 02:26:22 +08:00
parent caade5c791
commit 1ae8deca99

View File

@ -23,4 +23,18 @@ class Coupon extends Model
return PlanService::getPeriodKey($item);
})->toArray();
}
public function getLimitPlanIdsAttribute($value)
{
$planIds = json_decode($value, true);
if (blank($planIds)) {
return null;
}
return collect($planIds)
->map(fn($id) => (string) $id)
->values()
->all();
}
}