mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 19:56:29 +01:00
stations available tarif depending fix
This commit is contained in:
parent
9bc7a143bf
commit
af6b806c39
1 changed files with 31 additions and 0 deletions
|
@ -2205,6 +2205,9 @@ sub stations_available(){
|
||||||
|
|
||||||
#group_id must have 6 numbers like 300103
|
#group_id must have 6 numbers like 300103
|
||||||
my $pref_sql = "";
|
my $pref_sql = "";
|
||||||
|
|
||||||
|
#select by bike.type_id bike-group on booking update, to get available stations on bike return by filter logic
|
||||||
|
if(ref($record_pos) eq "HASH" && $record_pos->{int29}){
|
||||||
$pref_sql .= " and (";
|
$pref_sql .= " and (";
|
||||||
foreach my $type_id (@{$bike_group}){
|
foreach my $type_id (@{$bike_group}){
|
||||||
#on rental end select only stations which are defined
|
#on rental end select only stations which are defined
|
||||||
|
@ -2228,6 +2231,34 @@ sub stations_available(){
|
||||||
}
|
}
|
||||||
$pref_sql =~ s/OR$//;
|
$pref_sql =~ s/OR$//;
|
||||||
$pref_sql .= ")";
|
$pref_sql .= ")";
|
||||||
|
}
|
||||||
|
#select by bike.main_id Flot only if no booking update, to keep private/hidden Tarif logic
|
||||||
|
else{
|
||||||
|
$pref_sql .= " and (";
|
||||||
|
foreach my $main_id (@{$bike_node}){
|
||||||
|
#on rental end select only stations which are defined
|
||||||
|
#A-A rental
|
||||||
|
if($station_bike_node && $main_id =~ /(\d+)/ && $aa_station){
|
||||||
|
my $node_id = $1;
|
||||||
|
if($node_id == $station_bike_node){
|
||||||
|
$pref_sql .= " ct.int04 = $aa_station OR";
|
||||||
|
}
|
||||||
|
#A-B rental
|
||||||
|
}elsif($station_bike_node && $main_id =~ /(\d+)/){
|
||||||
|
my $node_id = $1;
|
||||||
|
if($node_id == $station_bike_node){
|
||||||
|
$pref_sql .= " ct.txt24 like '%$node_id%' OR";
|
||||||
|
}
|
||||||
|
#without a rental
|
||||||
|
}elsif($main_id =~ /(\d+)/){
|
||||||
|
my $node_id = $1;
|
||||||
|
$pref_sql .= " ct.txt24 like '%$node_id%' OR";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$pref_sql =~ s/OR$//;
|
||||||
|
$pref_sql .= ")";
|
||||||
|
}
|
||||||
|
|
||||||
$pref_sql = "" if($pref_sql !~ /\d/);
|
$pref_sql = "" if($pref_sql !~ /\d/);
|
||||||
|
|
||||||
$bw->log("stations_available --> station_bike_node:$station_bike_node|aa_station:$aa_station|bike_node:@{$bike_node}|bike_group:@{$bike_group}|pref_sql:\n",$pref_sql,"");
|
$bw->log("stations_available --> station_bike_node:$station_bike_node|aa_station:$aa_station|bike_node:@{$bike_node}|bike_group:@{$bike_group}|pref_sql:\n",$pref_sql,"");
|
||||||
|
|
Loading…
Add table
Reference in a new issue