Skip to content

Commit

Permalink
Optimize operation order fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejey committed Oct 23, 2023
1 parent 5c7ba75 commit 9adbfaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pChart/index.php
Expand Up @@ -208,7 +208,7 @@
}
//OPTIMIZE_LOG
if ($_GET['subop'] == 'optimize') {
$data = SQLSelect("SELECT * FROM $history_table WHERE VALUE_ID='" . $pvalue['ID'] . "' ORDER BY ADDED DESC");
$data = SQLSelect("SELECT * FROM $history_table WHERE VALUE_ID='" . $pvalue['ID'] . "' ORDER BY ADDED DESC, ID DESC");
$total = count($data);
$old_value = $data[0]['VALUE'];
for ($i = 1; $i < $total; $i++) {
Expand All @@ -223,7 +223,7 @@
}

if ($_GET['export']) {
$data = SQLSelect("SELECT * FROM $history_table WHERE VALUE_ID='" . $pvalue['ID'] . "' ORDER BY ADDED");
$data = SQLSelect("SELECT * FROM $history_table WHERE VALUE_ID='" . $pvalue['ID'] . "' ORDER BY ADDED, ID");
//dprint($data);

$csv = implode("\t", array('ADDED', 'VALUE')) . PHP_EOL;
Expand Down

0 comments on commit 9adbfaf

Please sign in to comment.