Minor cleanup in 'Handler_Public->getProfiles'
This commit is contained in:
parent
baf3ecd4cf
commit
cd52ca80ab
|
@ -268,16 +268,16 @@ class Handler_Public extends Handler {
|
||||||
if ($login) {
|
if ($login) {
|
||||||
$profiles = ORM::for_table('ttrss_settings_profiles')
|
$profiles = ORM::for_table('ttrss_settings_profiles')
|
||||||
->table_alias('p')
|
->table_alias('p')
|
||||||
->select_many('title' , ['profile_id' => 'p.id'])
|
->select_many('title' , 'p.id')
|
||||||
->join('ttrss_users', ['p.owner_uid', '=', 'u.id'], 'u')
|
->join('ttrss_users', ['owner_uid', '=', 'u.id'], 'u')
|
||||||
->where_raw('LOWER(u.login) = LOWER(?)', [$login])
|
->where_raw('LOWER(login) = LOWER(?)', [$login])
|
||||||
->order_by_asc('title')
|
->order_by_asc('title')
|
||||||
->find_many();
|
->find_many();
|
||||||
|
|
||||||
$rv = [ [ "value" => 0, "label" => __("Default profile") ] ];
|
$rv = [ [ "value" => 0, "label" => __("Default profile") ] ];
|
||||||
|
|
||||||
foreach ($profiles as $profile) {
|
foreach ($profiles as $profile) {
|
||||||
array_push($rv, [ "label" => $profile->title, "value" => $profile->profile_id ]);
|
array_push($rv, [ "label" => $profile->title, "value" => $profile->id ]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue