mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 12:07:28 +08:00
fix: coupon period limit
This commit is contained in:
@@ -25,20 +25,14 @@ class CouponResource extends JsonResource
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
...$this->resource->toArray(),
|
...$this->resource->toArray(),
|
||||||
'limit_plan_ids' => $this->when(
|
'limit_plan_ids' => empty($this->limit_plan_ids) ? null : collect($this->limit_plan_ids)
|
||||||
!empty($this->limit_plan_ids),
|
->map(fn(mixed $id): string => (string) $id)
|
||||||
fn() => collect($this->limit_plan_ids)
|
->values()
|
||||||
->map(fn(mixed $id): string => (string) $id)
|
->all(),
|
||||||
->values()
|
'limit_period' => empty($this->limit_period) ? null : collect($this->limit_period)
|
||||||
->all()
|
->map(fn(mixed $period): string => (string) PlanService::convertToLegacyPeriod($period))
|
||||||
),
|
->values()
|
||||||
'limit_period' => $this->when(
|
->all(),
|
||||||
!empty($this->limit_period),
|
|
||||||
fn() => collect($this->limit_period)
|
|
||||||
->map(fn(mixed $period): string => (string) PlanService::convertToLegacyPeriod($period))
|
|
||||||
->values()
|
|
||||||
->all()
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user