在这里,我使用多个 if else 如何在 switch case 中转换它。
if($ridestatus == 'Y' && $pass_status == 'Y'){
$status = '1';
}elseif($ridestatus == 'Y' && $pass_status == 'RNS'){
$status = 'RNS';
}elseif($ridestatus == 'RNS' && $pass_status == 'Y'){
$status = 'RNS';
}elseif($ridestatus == 'RNS' && $pass_status == 'RNS'){
$status = 'RNS';
}elseif($ridestatus == 'Y' && $pass_status == 'NR'){
$status = '1';
}elseif($ridestatus == 'RNS' && $pass_status == 'NR'){
$status = 'RNS';
}elseif($ridestatus == 'NR' && $pass_status == 'Y'){
$status = '1';
}elseif($ridestatus == 'NR' && $pass_status == 'RNS'){
$status = 'RNS';
}elseif($ridestatus == 'NR' || $ridestatus == '' && $pass_status == 'NR' || $pass_status == ''){
$status = '';
}