fixed interval counter

This commit is contained in:
Daniel Maya 2020-01-10 11:12:05 +01:00 committed by Daniel Rodriguez
parent 467db373b7
commit c9a524b128
2 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ function agents_get_next_contact_time_left(int $id_agente)
if ($id_agente > 0) {
$last_contact = db_get_value_sql(
sprintf(
'SELECT format(intervalo,2) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val"
'SELECT CAST(intervalo AS SIGNED) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto >= ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val"
FROM `tagente`
WHERE id_agente = %d ',
$id_agente

View File

@ -317,7 +317,7 @@ $data[1] = ui_progress(
1.8,
'#BBB',
true,
floor(($agent['intervalo'] * (100 - $progress) / 100)).' s',
($agent['intervalo'] - (strtotime('now') - strtotime($agent['ultimo_contacto']))).' s',
[
'page' => 'operation/agentes/ver_agente',
'interval' => (100 / $agent['intervalo']),