From 3e40315e4982d143c9bebedb0d843ba0aef28205 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 21 May 2007 21:40:55 +0000 Subject: [PATCH] updated AST_DEDUPE_leads.pl git-svn-id: svn://192.168.202.10@623 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/bin/VICIDIAL_DEDUPE_leads.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/agc_2-X/trunk/bin/VICIDIAL_DEDUPE_leads.pl b/agc_2-X/trunk/bin/VICIDIAL_DEDUPE_leads.pl index 8be82d2c..d1370ecd 100644 --- a/agc_2-X/trunk/bin/VICIDIAL_DEDUPE_leads.pl +++ b/agc_2-X/trunk/bin/VICIDIAL_DEDUPE_leads.pl @@ -239,18 +239,23 @@ $b=0; foreach(@dup_list) { $dup_limit = ($dup_count[$b] - 1); - $stmtA = "select lead_id,list_id,entry_date from vicidial_list where phone_number='$dup_list[$b]' $and $campSQL $listSQL order by entry_date desc limit $dup_limit;"; + $stmtA = "select lead_id,list_id,entry_date from vicidial_list where phone_number='$dup_list[$b]' $and $campSQL $listSQL order by entry_date;"; if($DBX){print STDERR "\n|$stmtA|\n";} $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; $rec_count=0; open(out, ">>$VDHLOGfile") || die "Can't open $VDHLOGfile: $!\n"; - print out "$dup_list[$b]|$dup_count[$b]\n"; + print out "$dup_list[$b]|$dup_count[$b]|"; while ($sthArows > $rec_count) { @aryA = $sthA->fetchrow_array; - print out "$aryA[0]|$aryA[1]|$aryA[2]\n"; + if ($rec_count<1) {print out "$aryA[0]|$aryA[1]|$aryA[2]\n";} + else + { + print out " $aryA[0]|$aryA[1]|$aryA[2]\n"; + $DUP_updates .= "'$aryA[0]',"; + } $rec_count++; } close(out); @@ -270,6 +275,9 @@ foreach(@dup_list) if ($b =~ /000$/i) {print "|$b|$phone_number|\n";} } +chop($DUP_updates); + + if($DBX){print STDERR "\nDUP UPDATES|$DUP_updates|\n";}