在此示例中,我有两种显示方式,car
为hired
,where
以及fuel type
。如果为different
weekday
选择了汽车,则会出现以下情况:
福特,费城,柴油
丰田,费城,柴油
日产,费城,柴油,
如果我整整一周选择一辆车,那么只有一辆车:
福特,费城,柴油
这是代码,我用来显示它们:
} else {
$carnames = array();
foreach ($carname as $carraw) {
$hirestation = array();
if (!empty($carraw->name)) {
$hirestation[] = $carraw->name;
}
if (!empty($carraw->cartype)) {
$hirestation[] = $carraw->cartype;
}
if (!empty($carraw->address)) {
$hirestation[] = $carraw->carfuel;
}
$carname = implode(', ', $hirestation);
$dedupedroomnames[] = $roomname;
}
$carnames = implode('; ', $carnames);
$strcar = (!empty($allcarnames)) ? $carnames : $carnull;
}
problem
是,如果本周有multiple
cars
,最后总会有two comas
:
Ford,Philadelphia,Diesel,
经过检查后,我发现car
whole week
来自together
,如果我选择single choices
function assignDatesToArbitrationCase(caseID, dateType,dt){
var urlAssignDate = ConfigService.getBaseURL() + '/legalcase/legalcasedatetype'
var assignDateStr = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:leg="http://schemas.arccorp.com/services/airlinesalesreporting/legalCaseDateTypeV1"> ' +
'<soapenv:Header/> <soapenv:Body> <leg:assignToRequest> <leg:entity> ' +
'<leg:id legalCaseId="' + caseID + '" dateTypeId="' +dateType + '"/> ' +
'<leg:legalCaseDateTypeDt>' + dateFormatForServer(dt) + '</leg:legalCaseDateTypeDt>' +
'</leg:entity> </leg:assignToRequest> </soapenv:Body> </soapenv:Envelope>';
return $http({
url: urlAssignDate,
method: 'POST',
data: assignDateStr
}).then(function (results) {
var jsonObject = x2js.xml_str2json(results.data);
return jsonObject;
})
}
:
Ford,Philadelphia,Diesel, Dodge,D.C,Gas ,
我在代码中缺少什么?
答案 0 :(得分:3)