daysByStarValue((string) $starItem->value); if ($days === null) { return null; } $base = $base ? Carbon::parse($base) : Carbon::today(); return $base->copy()->addDays($days); } /** * @return int|null 追加天数;null 表示不生成下次跟进日 */ public function daysByStarValue(string $value): ?int { return match ($value) { '1' => 365, '2', '3' => 180, '4', '5' => 90, default => null, }; } public function starLabelToValue(string $label): ?string { return match ($label) { '一星' => '1', '二星' => '2', '三星' => '3', '四星' => '4', '五星' => '5', '待定' => 'pending', default => null, }; } }