mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-07 15:07:15 +08:00
Merge pull request #8108 from artoscinote/ma_SCI_11261
Fix counts for archived and assigned repository rows [SCI-11261]
This commit is contained in:
commit
15d3d55fdd
1 changed files with 7 additions and 1 deletions
|
|
@ -144,7 +144,13 @@ class RepositoryDatatableService
|
|||
|
||||
repository_rows = repository_rows.where(id: advanced_search(repository_rows)) if @params[:advanced_search].present?
|
||||
|
||||
@filtered_count = repository_rows.count
|
||||
@filtered_count =
|
||||
if @assigned_view
|
||||
repository_rows.joins(:my_module_repository_rows)
|
||||
.where(my_module_repository_rows: { my_module_id: @my_module }).count
|
||||
else
|
||||
repository_rows.where(archived: !@params[:archived].nil? && @params[:archived]).count
|
||||
end
|
||||
|
||||
repository_rows.joins('LEFT OUTER JOIN "users" "created_by" ON "created_by"."id" = "repository_rows"."created_by_id"')
|
||||
.joins('LEFT OUTER JOIN "users" "last_modified_by" ON "last_modified_by"."id" = "repository_rows"."last_modified_by_id"')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue