added history timestamps to export
This commit is contained in:
@@ -12,6 +12,7 @@ if(!$no_filename) {
|
||||
$status_flags_header = [];
|
||||
foreach(PreorderStatusflagModel::getAll() as $sflag) {
|
||||
$status_flags_header[$sflag->code] = $sflag->code;
|
||||
$status_flags_header[$sflag->code . " Datum"] = $sflag->code . " Datum";
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -35,6 +36,16 @@ while($data = mysqli_fetch_object($res)):
|
||||
$statusflags = [];
|
||||
foreach($preorder->statusflags as $sflag) {
|
||||
$statusflags[$sflag->code] = $sflag->value->value ? 1 : 0;
|
||||
if($sflag->value->value) {
|
||||
$historyEntry = PreorderHistoryModel::getFirst([
|
||||
"preorder_id" => $preorder->id,
|
||||
"key" => "preorderstatusflag-".$sflag->id."-value",
|
||||
"new_value" => 1
|
||||
]);
|
||||
$statusflags[$sflag->code . " Datum"] = ($historyEntry) ? date("Y-m-d H:i:s", $historyEntry->create) : "";
|
||||
} else {
|
||||
$statusflags[$sflag->code . " Datum"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
$discounts = [];
|
||||
|
||||
Reference in New Issue
Block a user