sigo api rental fork

This commit is contained in:
ragu 2022-05-11 08:05:35 +02:00
parent 0163c06893
commit dd9be5f40e
14 changed files with 283 additions and 161 deletions

View file

@ -781,16 +781,16 @@ sub send_password(){
}
#sigobike just like caching and not realy used by app
sub sigobike_cupdate {
#sigbike just like caching and not realy used by app
sub sigbike_cupdate {
my $self = shift;
my $record_sigo = shift;
my $record_sig = shift;
my $dbh = "";
my $rows = 0;
foreach my $bid (keys (%$record_sigo)){
foreach my $bid (keys (%$record_sig)){
my $update = {
%{$record_sigo->{$bid}},
%{$record_sig->{$bid}},
table => "content",
template_id => "205",
main_id => "300102",
@ -798,12 +798,12 @@ sub sigobike_cupdate {
owner => "169",
};
$bw->log("UPDATE content from record_sigo with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sigo->{$bid});
$bw->log("UPDATE content from record_sig with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sig->{$bid});
if($rows != 1){
my $c_id = "";
$update->{itime} = "now()";
$bw->log("INSERT content from record_sigo with bike nr:",$update,"");
$bw->log("INSERT content from record_sig with bike nr:",$update,"");
$c_id = $dbt->insert_contentoid($dbh,$update,"");
$rows = 1 if($c_id);
}
@ -812,16 +812,16 @@ sub sigobike_cupdate {
}
#sigostation just like caching and not realy used by app
sub sigostation_cupdate {
#sigstation just like caching and not realy used by app
sub sigstation_cupdate {
my $self = shift;
my $record_sigo = shift;
my $record_sig = shift;
my $dbh = "";
my $rows = 0;
foreach my $sid (keys (%$record_sigo)){
foreach my $sid (keys (%$record_sig)){
my $update = {
%{$record_sigo->{$sid}},
%{$record_sig->{$sid}},
table => "content",
template_id => "225",
main_id => "300016",
@ -829,12 +829,12 @@ sub sigostation_cupdate {
owner => "169",
};
$bw->log("UPDATE content from record_sigo with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sigo->{$sid});
$bw->log("UPDATE content from record_sig with bike nr:",$update,"");
$rows = $dbt->update_record($dbh,$update,$record_sig->{$sid});
if($rows != 1){
my $c_id = "";
$update->{itime} = "now()";
$bw->log("INSERT content from record_sigo with bike nr:",$update,"");
$bw->log("INSERT content from record_sig with bike nr:",$update,"");
$c_id = $dbt->insert_contentoid($dbh,$update,"");
$rows = 1 if($c_id);
}