parent
1378aefa9c
commit
b906cf7b88
11 changed files with 96 additions and 13 deletions
|
|
@ -54,6 +54,19 @@ final class PricingService
|
|||
}
|
||||
return (int) $rule[$sterilized ? 'fee_after_sterilization' : 'fee_before_sterilization'];
|
||||
}
|
||||
|
||||
public static function deleteTariff(int $id): ?string
|
||||
{
|
||||
$db = DB::pdo();
|
||||
$stmt = $db->prepare('SELECT label FROM clinic_tariffs WHERE id=:id');
|
||||
$stmt->execute([':id' => $id]);
|
||||
$label = $stmt->fetchColumn();
|
||||
if ($label === false) {
|
||||
return null;
|
||||
}
|
||||
$db->prepare('DELETE FROM clinic_tariffs WHERE id=:id')->execute([':id' => $id]);
|
||||
return (string) $label;
|
||||
}
|
||||
public static function tariffs(bool $active = false): array
|
||||
{
|
||||
$w = $active ? 'WHERE ct.active=1 AND dc.deleted_at IS NULL' : '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue