24h SMS update marker

This commit is contained in:
Rainer Gümpelein 2022-03-15 13:05:21 +01:00
parent df954371f2
commit b7de896e71
3 changed files with 24 additions and 11 deletions

View file

@ -58,6 +58,9 @@ if($todo eq "24h_occupied"){
int10 => 3,
start_time_interval => "(now() - interval '1 day')",
};
my $update_pos = {
table => "contenttranspos",
};
my $dt1 = DateTime->now(time_zone => "Europe/Berlin");
@ -76,17 +79,26 @@ if($todo eq "24h_occupied"){
#print $dt1 . ">=" . $dt2_72h_occupied . "|" . $dt1 . ">=" . $dt2_48h_occupied . "|" . $dt1 . ">=" . $dt2_24h_occupied . "\n";
if($dt2){
if($dt1 >= $dt2_72h_occupied){
$todo = "72h_occupied";
$smstrans->sms_message($dt1 >= $dt2_72h_occupied,$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
print $dt1 . ">=" . $dt2_72h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
if($cttpos->{$pid}->{int33} != 3){
$todo = "72h_occupied";
print $dt1 . ">=" . $dt2_72h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
$dbt->update_one($dbh,$update_pos,"int33=3",$cttpos->{$pid}->{c_id});
}
}elsif($dt1 >= $dt2_48h_occupied){
$todo = "48h_occupied";
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
if($cttpos->{$pid}->{int33} != 2){
$todo = "48h_occupied";
print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
$dbt->update_one($dbh,$update_pos,"int33=2",$cttpos->{$pid}->{c_id});
}
}elsif($dt1 >= $dt2_24h_occupied){
$todo = "24h_occupied";
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
if($cttpos->{$pid}->{int33} != 1){
$todo = "24h_occupied";
print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
$smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
$dbt->update_one($dbh,$update_pos,"int33=1",$cttpos->{$pid}->{c_id});
}
}
}
sleep 1;