[86400, 'acp.auc.day', 'acp.auc.days'], 'hour' => [3600, 'acp.auc.hour', 'acp.auc.hours'], 'minute' => [60, 'acp.auc.minute', 'acp.auc.minutes'], 'second' => [1, 'acp.auc.second', 'acp.auc.seconds'], ]; $parts = []; foreach ($units as [$value, $oneKey, $manyKey]) { $qty = intdiv($seconds, $value); if ($qty > 0) { $seconds -= $qty * $value; $parts[] = $qty . ' ' . t($qty === 1 ? $oneKey : $manyKey); } } return implode(', ', $parts); } // --------------------------------------------------------------------------- // Passive sweep: a bid period that ran out with a bidder on it is a sale. // --------------------------------------------------------------------------- $expired = db()->fetchAll(" SELECT `id` FROM `znote_auction_player` WHERE `sold` = 0 AND `time_end` < ? AND `bidder_account_id` > 0; ", [$now]); if (is_array($expired) && $expired) { $soldIds = array_map(static fn($a) => (int)$a['id'], $expired); $placeholders = implode(',', array_fill(0, count($soldIds), '?')); db()->execute(" UPDATE `znote_auction_player` SET `sold` = 1 WHERE `id` IN ({$placeholders}); ", $soldIds); } // --------------------------------------------------------------------------- // The three lists // --------------------------------------------------------------------------- $characterFields = " `za`.`id` AS `zaid`, `za`.`price`, `za`.`bid`, `za`.`time_begin`, `za`.`time_end`, `p`.`id` AS `player_id`, `p`.`name`, `p`.`vocation`, `p`.`level` "; $pending = db()->fetchAll(" SELECT {$characterFields} FROM `znote_auction_player` `za` INNER JOIN `players` `p` ON `za`.`player_id` = `p`.`id` WHERE `p`.`account_id` = ? AND `za`.`claimed` = 0 AND `za`.`sold` = 1 ORDER BY `za`.`time_end` DESC; ", [$storageAccountId]); $ongoing = db()->fetchAll(" SELECT {$characterFields} FROM `znote_auction_player` `za` INNER JOIN `players` `p` ON `za`.`player_id` = `p`.`id` WHERE `p`.`account_id` = ? AND `za`.`sold` = 0 ORDER BY `za`.`time_end` DESC; ", [$storageAccountId]); $completed = db()->fetchAll(" SELECT {$characterFields} FROM `znote_auction_player` `za` INNER JOIN `players` `p` ON `za`.`player_id` = `p`.`id` WHERE `za`.`claimed` = 1 ORDER BY `za`.`time_end` DESC; "); $pending = is_array($pending) ? $pending : []; $ongoing = is_array($ongoing) ? $ongoing : []; $completed = is_array($completed) ? $completed : []; ?>
'$config[\'shop_auction\'][\'storage_account_id\']']) ?>

(int)$c['time_end']; ?>
 
acp_duration((int)$c['time_end'] - $now)]) ?>
> $rows */ function acp_auction_table(array $rows, string $title, string $subtitle, string $emptyText): void { ?>

'$config[\'shop_auction\']']) ?>