Skip to content

Commit 9adbfaf

Browse files
committed
Optimize operation order fix
1 parent 5c7ba75 commit 9adbfaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pChart/index.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
}
209209
//OPTIMIZE_LOG
210210
if ($_GET['subop'] == 'optimize') {
211-
$data = SQLSelect("SELECT * FROM $history_table WHERE VALUE_ID='" . $pvalue['ID'] . "' ORDER BY ADDED DESC");
211+
$data = SQLSelect("SELECT * FROM $history_table WHERE VALUE_ID='" . $pvalue['ID'] . "' ORDER BY ADDED DESC, ID DESC");
212212
$total = count($data);
213213
$old_value = $data[0]['VALUE'];
214214
for ($i = 1; $i < $total; $i++) {
@@ -223,7 +223,7 @@
223223
}
224224

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

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

0 commit comments

Comments
 (0)