示例#1
0
 public function getConfirmedByCountry($stage_id)
 {
     $stage_name = $this->getNameByID($stage_id);
     $stage_fields = $this->addition_fields_list();
     $users_bought_stage = User::getBoughtStage($stage_fields['name'] . $stage_name, $stage_id);
     $stage_counter = array('SG' => 0, 'MYR' => 0);
     foreach ($users_bought_stage as $user_obj) {
         $user_id = $user_obj->ID;
         $user_form_id = User::getRegistrationFormID($user_id);
         $user_country = User::getRegistrationForm($user_form_id)[11] === 'singapore' ? $stage_counter['SG']++ : $stage_counter['MYR']++;
     }
     $response1 = $stage_counter['SG'] > 0 ? $stage_counter['SG'] . 'SG' : '0SG';
     $response2 = $stage_counter['MYR'] > 0 ? $stage_counter['MYR'] . 'MYR' : '0MYR';
     #$response = !empty($response1) && !empty($response2) ? $response1 . ' - ' . $response2 : empty($response1) && !empty($response2) ? $response2 : !empty($response1) && empty($response2) ? $response1 : 0;
     $response = $response1 . ' - ' . $response2;
     return $response;
 }