Skip to content

Commit

Permalink
feat(Alerts): sort alerts by test id
Browse files Browse the repository at this point in the history
  • Loading branch information
domtra committed Oct 24, 2024
1 parent 5ad79cd commit e603f68
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/models/class-alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public static function get_items_by_test_run( $id = 0 ) {
return $wpdb->get_results(
$wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- It's ok.
"SELECT a.* FROM $alerts_table a JOIN $tests_table t ON a.post_id = t.post_id WHERE a.test_run_id = %d ORDER BY t.post_id ASC",
"SELECT a.* FROM $alerts_table a JOIN $tests_table t ON a.post_id = t.post_id WHERE a.test_run_id = %d ORDER BY t.id DESC",
$id
)
);
Expand Down
2 changes: 1 addition & 1 deletion includes/models/class-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static function get_items_by_ids( $ids = [] ) {
return $wpdb->get_results(
$wpdb->prepare(
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- It's ok.
"SELECT * FROM $tests_table WHERE id IN (" . implode( ',', array_fill( 0, count( $ids ), '%d' ) ) . ') ORDER BY post_id ASC',
"SELECT * FROM $tests_table WHERE id IN (" . implode( ',', array_fill( 0, count( $ids ), '%d' ) ) . ') ORDER BY id DESC',
$ids
)
);
Expand Down

0 comments on commit e603f68

Please sign in to comment.