Duplicating Restruants not working #4750

This commit is contained in:
Pererinha 2015-02-13 16:43:33 -02:00
parent 82fbf156c4
commit e7e03ef539

View File

@ -247,12 +247,15 @@ class Crunchbutton_Restaurant extends Cana_Table_Trackchange {
public function activeDrivers(){ public function activeDrivers(){
$community = $this->community()->get( 0 ); $community = $this->community()->get( 0 );
$activeDrivers = 0; $activeDrivers = 0;
$drivers = $community->getDriversOfCommunity(); if( $community->id_community ){
foreach( $drivers as $driver ){ $drivers = $community->getDriversOfCommunity();
if( $driver->isWorking() ){ foreach( $drivers as $driver ){
$activeDrivers++; if( $driver->isWorking() ){
$activeDrivers++;
}
} }
} }
return $activeDrivers; return $activeDrivers;
} }