distribute scheduled nodes evenly by filling days sequentially
This commit is contained in:
parent
358694e7e3
commit
49663d70d9
2 changed files with 52 additions and 1 deletions
|
|
@ -82,8 +82,9 @@ class CreatePlan
|
|||
$currentDate = $currentDate->modify('+1 day');
|
||||
}
|
||||
|
||||
$nodesPerDay = (int) ceil(count($nodesOfText) / count($dates));
|
||||
foreach ($nodesOfText as $index => $node) {
|
||||
$dateIndex = $index % count($dates);
|
||||
$dateIndex = (int) floor($index / $nodesPerDay);
|
||||
$scheduledDate = $dates[$dateIndex];
|
||||
|
||||
$this->createScheduledNode->execute(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue