ManageTags: display owning user in table

This commit is contained in:
Aaron van Geffen 2023-03-11 20:39:55 +01:00
parent 310fe7c3d6
commit 5cff62836e

View File

@ -50,10 +50,18 @@ class ManageTags extends HTMLController
'data' => 'slug',
],
],
'kind' => [
'header' => 'Kind',
'id_user_owner' => [
'header' => 'Owning user',
'is_sortable' => true,
'value' => 'kind',
'parse' => [
'type' => 'function',
'data' => function($row) {
if (!empty($row['first_name']))
return $row['first_name'] . ' ' . $row['surname'];
else
return 'n/a';
},
],
],
'count' => [
'header' => 'Cardinality',
@ -76,8 +84,9 @@ class ManageTags extends HTMLController
$direction = 'up';
$data = Registry::get('db')->queryAssocs('
SELECT *
FROM tags
SELECT t.*, u.id_user, u.first_name, u.surname
FROM tags AS t
LEFT JOIN users AS u ON t.id_user_owner = u.id_user
WHERE kind != {string:album}
ORDER BY {raw:order}
LIMIT {int:offset}, {int:limit}',