issue #0001250 : Réactivation surveillance supprimé
This commit is contained in:
parent
287024f59e
commit
b5bda73c09
@ -3461,14 +3461,26 @@ class Entreprise extends WsScore
|
||||
|
||||
$where = "source='$source' AND login='$login' AND email='$email' AND siren=$siren AND nic=$nic AND ref='$ref'";
|
||||
|
||||
//Si la donnée existe déjà alors il faut mettre à jour l'encours client
|
||||
$detect = $iDb->select('surveillances_site', 'siren', $where, false, MYSQL_ASSOC);
|
||||
if ( count($detect)>0 ) {
|
||||
|
||||
$data = array(
|
||||
'encoursClient' => $encoursClient,
|
||||
);
|
||||
$result = $iDb->update('surveillances_site', $data, $where);
|
||||
//Si la donnée existe déjà et que la source=score alors il faut mettre à jour l'encours client
|
||||
if ($source == 'score' && $detect[0]['dateSuppr']=='0000-00-00 00:00:00') {
|
||||
|
||||
$data = array (
|
||||
'encoursClient' => $encoursClient,
|
||||
);
|
||||
$result = $iDb->update('surveillances_site', $data, $where);
|
||||
|
||||
} elseif ( $detect[0]['dateSuppr']!='0000-00-00 00:00:00') {
|
||||
|
||||
$data = array (
|
||||
'dateAjout' => date('Y-m-d'),
|
||||
'dateSuppr' => '0000-00-00 00:00:00',
|
||||
);
|
||||
$result = $iDb->update('surveillances_site', $data, $where);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user