forked from mirrors/homebox
pr: fixed incorrect sum of the total items price (#568)
* Fixed incorrect sum of the total items price https://github.com/hay-kot/homebox/issues/458 * fix eslint errors --------- Co-authored-by: Adamko <33964772+cRaZy92@users.noreply.github.com>
This commit is contained in:
parent
a9712c48af
commit
f13bf2958d
3 changed files with 8 additions and 23 deletions
|
@ -233,7 +233,7 @@ func (r *GroupRepository) StatsGroup(ctx context.Context, GID uuid.UUID) (GroupS
|
|||
(SELECT COUNT(*) FROM items WHERE group_items = ? AND items.archived = false) AS total_items,
|
||||
(SELECT COUNT(*) FROM locations WHERE group_locations = ?) AS total_locations,
|
||||
(SELECT COUNT(*) FROM labels WHERE group_labels = ?) AS total_labels,
|
||||
(SELECT SUM(purchase_price) FROM items WHERE group_items = ? AND items.archived = false) AS total_item_price,
|
||||
(SELECT SUM(purchase_price*quantity) FROM items WHERE group_items = ? AND items.archived = false) AS total_item_price,
|
||||
(SELECT COUNT(*)
|
||||
FROM items
|
||||
WHERE group_items = ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue