mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-14 08:37:00 +02:00
More custom price per registrar preparations
This commit is contained in:
parent
52409dcfbd
commit
0799781491
3 changed files with 27 additions and 9 deletions
|
@ -515,7 +515,7 @@ function updatePermittedIPs($pool, $permittedIPsTable) {
|
|||
}
|
||||
}
|
||||
|
||||
function getDomainPrice($pdo, $domain_name, $tld_id, $date_add = 12, $command = 'create') {
|
||||
function getDomainPrice($pdo, $domain_name, $tld_id, $date_add = 12, $command = 'create', $registrar_id = null) {
|
||||
// Check if the domain is a premium domain
|
||||
$stmt = $pdo->prepare("
|
||||
SELECT c.category_price
|
||||
|
@ -556,8 +556,17 @@ function getDomainPrice($pdo, $domain_name, $tld_id, $date_add = 12, $command =
|
|||
|
||||
// Get regular price for the specified period
|
||||
$priceColumn = "m" . $date_add;
|
||||
$stmt = $pdo->prepare("SELECT $priceColumn FROM domain_price WHERE tldid = ? AND command = '$command' LIMIT 1");
|
||||
$stmt->execute([$tld_id]);
|
||||
$sql = "
|
||||
SELECT $priceColumn
|
||||
FROM domain_price
|
||||
WHERE tldid = ?
|
||||
AND command = ?
|
||||
AND (registrar_id = ? OR registrar_id IS NULL)
|
||||
ORDER BY registrar_id DESC
|
||||
LIMIT 1
|
||||
";
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute([$tld_id, $command, $registrar_id]);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$regularPrice = $stmt->fetch()[$priceColumn];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue