Merge branch 'ent-4693-Pete-en-el-contador-de-intervalo-de-agente-con-intervalo-largo' into 'develop'

fixed interval counter

See merge request artica/pandorafms!2938
This commit is contained in:
Daniel Rodriguez 2020-01-10 11:12:05 +01:00
commit 1ebcfd58e4
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) { if ($id_agente > 0) {
$last_contact = db_get_value_sql( $last_contact = db_get_value_sql(
sprintf( 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` FROM `tagente`
WHERE id_agente = %d ', WHERE id_agente = %d ',
$id_agente $id_agente

View File

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