Exemplo n.º 1
0
 public static function processingBusinessBool($business_id)
 {
     /*
       $filepath = public_path() . '/json/' . $business_id . '.json';
       $data = json_decode(file_get_contents($filepath));
       if ($data->box1->number != '') {
           return TRUE;
       } elseif (isset($data->box2)) {
           if ($data->box2->number != '') {
               return TRUE;
           }
       } elseif (isset($data->box3)) {
           if ($data->box3->number != '') {
               return TRUE;
           }
       } elseif (isset($data->box4)) {
           if ($data->box4->number != '') {
               return TRUE;
           }
       } elseif (isset($data->box5)) {
           if ($data->box5->number != '') {
               return TRUE;
           }
       } elseif (isset($data->box6)) {
           if ($data->box6->number != '') {
               return TRUE;
           }
       } elseif ($data->get_num != '') {
           return TRUE;
       }
       return FALSE;
     */
     // will be using Aunne's data from process queue to determine if the business is active or inactive
     $first_service = Service::getFirstServiceOfBusiness($business_id);
     $all_numbers = ProcessQueue::allNumbers($first_service->service_id);
     $is_calling = count($all_numbers->called_numbers) > 0 ? true : false;
     $is_issuing = count($all_numbers->uncalled_numbers) + count($all_numbers->timebound_numbers) > 0 ? true : false;
     return $is_calling || $is_issuing;
 }