26 lines
649 B
PHP
26 lines
649 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Repositories;
|
|
|
|
final class PromocodeRepository extends BaseRepository
|
|
{
|
|
/**
|
|
* @return array<int, array<string, mixed>>
|
|
*/
|
|
public function priceTiers(): array
|
|
{
|
|
$statement = $this->pdo()->query(
|
|
'SELECT code, title, discount_type, discount_value, min_order_amount, price_tier_label, payment_note
|
|
FROM promocodes
|
|
WHERE is_active = 1
|
|
AND show_in_price_tiers = 1
|
|
AND discount_type = "percent"
|
|
ORDER BY min_order_amount, discount_value'
|
|
);
|
|
|
|
return $statement->fetchAll();
|
|
}
|
|
}
|