can you try with \PDO::ATTR_STRINGIFY_FETCHES false in your DB connection
$this->di->set('db', function() use ($config) {
$class = new \Phalcon\Db\Adapter\Pdo\Mysql([
'host' => $config->database->host,
'username' => $config->database->username,
'password' => $config->database->password,
'dbname' => $config->database->dbname,
'port' => '3306',
'charset' => 'utf8',
"options" => [
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
\PDO::ATTR_PERSISTENT => true,
\PDO::ATTR_EMULATE_PREPARES => false,
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_STRINGIFY_FETCHES => false <<------- TRY WITH THIS ONE
]
]);
return $class;
}, true);