Answer the question
In order to leave comments, you need to log in
How to substitute the value of the array at each iteration?
$arFilterOplataPoSchetam = array("IBLOCK_ID" => "89", "ID" => $arProps['OPLATY_PO_SCHETAM']['VALUE'][0], ">=DATE_CREATE" => $minDate,
"<=DATE_CREATE" => $maxDate,);
$summaPlatejeiDolgNaDatu = 0;
$resOplataPoSchetamDluaDolgNaDatu = CIBlockElement::GetList(
array("DATE_CREATE" => 'ASC'),
$arFilterOplataPoSchetam,
false,
array(),
$arSelectOplataPoSchetam
);
while ($obOplataPoSchetamDluaDolgNaDatu = $resOplataPoSchetamDluaDolgNaDatu->GetNextElement()) {
$arFieldsOplataPoSchetamDluaDolgNaDatu = $obOplataPoSchetamDluaDolgNaDatu->GetFields();
}
Answer the question
In order to leave comments, you need to log in
Please structure your code so that there are no jumping indents.
As for the task, if $arProps['OPLATY_PO_SCHETAM']['VALUE'] contains an array of identifiers, then this will also work.
That is, if yours looks like:
$arProps['OPLATY_PO_SCHETAM']['VALUE'] = [
1,
2,
3,
4
];
$arFilterOplataPoSchetam = array(
"IBLOCK_ID" => "89",
"ID" => $arProps['OPLATY_PO_SCHETAM']['VALUE'],
">=DATE_CREATE" => $minDate,
"<=DATE_CREATE" => $maxDate
);
$debtsOnDate = [];
while ($obOplataPoSchetamDluaDolgNaDatu = $resOplataPoSchetamDluaDolgNaDatu->GetNextElement()) {
$debtsOnDate[] = $obOplataPoSchetamDluaDolgNaDatu->GetFields();
}
while ( $debtOnDate = $resOplataPoSchetamDluaDolgNaDatu->GetNext() )
{
$debtsOnDate[] = $debtOnDate;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question