Skip to content

Commit 77e6b51

Browse files
committed
Sort used by list by sort column in products table
1 parent b44d68e commit 77e6b51

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/libraries/Packet.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,13 @@ public function getUsedBy() {
521521

522522
$stmt = Common::$database->prepare('
523523
SELECT
524-
`bnet_product_id`
525-
FROM `packet_used_by`
526-
WHERE `id` = :id
527-
ORDER BY `id` ASC;
524+
`used`.`bnet_product_id`
525+
FROM `packet_used_by` AS `used`
526+
INNER JOIN
527+
`products` AS `prods`
528+
ON `used`.`bnet_product_id` = `prods`.`bnet_product_id`
529+
WHERE `used`.`id` = :id
530+
ORDER BY `prods`.`sort` ASC;
528531
');
529532

530533
$stmt->bindParam( ':id', $this->id, PDO::PARAM_INT );

0 commit comments

Comments
 (0)