public static function get_all_member($user_not_include, $event_id) { $query_data = []; $array_data = []; foreach ($user_not_include as $data => $value) { $query_data[] = [$value]; } $user_detail = Member::whereNotIn('id', $query_data)->get(); foreach ($user_detail as $data) { $user_id = $data->id; $event_date = AS_Requestjob::get_event_date($event_id); $userstatus = Check_busy::main($user_id, $event_date); $usernameall = $data->nickname . " - " . $data->name . " " . $data->surname; $usergrade = AS_Member::get_user_detail($user_id, 'grade'); $sortgrade = AS_Member::get_user_detail($user_id, 'sortgrade'); $assign_id = ""; $category = "all_user"; $array_data[] = ["user_id" => $user_id, "usernameall" => $usernameall, "usergrade" => $usergrade, "sortgrade" => $sortgrade, "userstatus" => $userstatus, "assign_id" => $assign_id, "category" => $category]; } usort($array_data, function ($a, $b) { return $b["sortgrade"] - $a["sortgrade"]; }); return $array_data; }