шаг 3 завершен
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user