mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-13 15:16:38 +02:00
beta App api extension with bikes-occupied on bikes-available request. Rental freed-time without rental-count restriction on TR.
This commit is contained in:
parent
60f21a4f85
commit
44d47011af
5 changed files with 85 additions and 38 deletions
|
@ -505,6 +505,7 @@ elsif($q->param('request') eq "bikes_available"){
|
|||
}else{
|
||||
($aowner,my $return_merchant) = $apif->fetch_merchant($q,\%varenv,$coo,$q->param('merchant_id'));
|
||||
$varenv{merchant_id} = $return_merchant->{merchant_id};
|
||||
$response = { %$response, %$return_merchant };
|
||||
|
||||
#on operator loop select, operator adr must be select to get user_group
|
||||
my $auth = {};
|
||||
|
@ -519,12 +520,20 @@ elsif($q->param('request') eq "bikes_available"){
|
|||
}else{
|
||||
$response->{bikes} = $apif->bikes_available($q,\%varenv,\%varenv,$authraw);
|
||||
}
|
||||
|
||||
#return also bikes_occupied on bikes_available by operator request
|
||||
if(1==1 && $varenv{syshost} ne "shareeapp-primary" && $dbt->{copri_conf}->{betau_id}->{$authraw->{c_id}}){
|
||||
#return list of occupied/requested bikes
|
||||
my $record = {};
|
||||
$record = $apif->user_bikes_occupied($dbh,$authraw,"");
|
||||
$response->{bikes_occupied} = $apif->rentals(\%varenv,$record,$authraw,"1");#returns JSON rental values
|
||||
}
|
||||
}
|
||||
if(ref($response->{bikes}) ne "HASH"){
|
||||
$response->{response_state} = "Failure 5003: cannot find any user defined bike tariff";
|
||||
$response->{response_text} = "Abbruch, es konnte kein gültiger Tarif gefunden werden";
|
||||
}
|
||||
}
|
||||
}#end bikes_available
|
||||
|
||||
#bikes_all with service_state calculater
|
||||
#cronjob for maintenance update runs at ~ 7:00
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue