<?php

function smarty_function_get_skeet_data($params, &$smarty)
{
    if (!($orderId = $params['id_order'] ?? false)) {
        return;
    }

    $result = sqlQueryBuilder()
        ->select('*')
        ->from('sk_eet_payment')
        ->andWhere(\Query\Operator::equals(['id_order' => $orderId]))
        ->execute()
        ->fetchAllAssociative();

    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $result);
    } else {
        return $result;
    }
}
