forked from ZwiiCMS-Team/ZwiiCampus
Update json to csv ok
This commit is contained in:
parent
c0d14596a7
commit
6bc8636692
@ -30,16 +30,17 @@ if (
|
||||
foreach ($this->getData(['enrolment']) as $courseId => $users) {
|
||||
$filename = self::DATA_DIR . $courseId . '/report.csv';
|
||||
$fp = fopen($filename, 'w');
|
||||
|
||||
foreach ($users as $userId => $userData) {
|
||||
$history = $userData['history'];
|
||||
$history = array_key_exists('history', $userData) ? $userData['history'] : null;
|
||||
|
||||
if (is_array($history)) {
|
||||
foreach ($history as $pageId => $timestamps) {
|
||||
foreach ($timestamps as $timestamp) {
|
||||
fputcsv($fp, [$userId, $pageId, $timestamp]);
|
||||
fputcsv($fp, [$userId, $pageId, $timestamp], ';');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
}
|
||||
//$this->setData(['core', 'dataVersion', 1800]);
|
||||
|
Loading…
Reference in New Issue
Block a user