partial: driver dumbphone tweaks #2673
This commit is contained in:
parent
01c7278529
commit
e3e664d282
@ -122,6 +122,19 @@ class Crunchbutton_Admin extends Cana_Table {
|
||||
}
|
||||
$adminCommunities = [];
|
||||
$groups = $this->groups();
|
||||
foreach ( $groups as $group ) {
|
||||
$communities = Crunchbutton_Community::communityByDriverGroup( $group->name );
|
||||
foreach( $communities as $community ){
|
||||
$restaurants = $community->getRestaurants();
|
||||
foreach( $restaurants as $restaurant ){
|
||||
if( $restaurant->delivery_service ){
|
||||
$deliveryFor[ $restaurant->id_restaurant ] = $restaurant->id_restaurant;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// legacy
|
||||
foreach ( $groups as $group ) {
|
||||
if( strpos( $group->name, Crunchbutton_Group::DRIVER_GROUPS_PREFIX ) !== false ){
|
||||
$community = str_replace( Crunchbutton_Group::DRIVER_GROUPS_PREFIX, '', $group->name );
|
||||
|
||||
@ -138,6 +138,10 @@ class Crunchbutton_Community extends Cana_Table {
|
||||
return $group;
|
||||
}
|
||||
|
||||
public function communityByDriverGroup( $group ){
|
||||
return Crunchbutton_Community::q( 'SELECT * FROM community WHERE driver_group = "' . $group . '"' );
|
||||
}
|
||||
|
||||
public function getDriversOfCommunity(){
|
||||
$group = $this->driverGroup();
|
||||
$query = 'SELECT a.* FROM admin a
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user