separate user for the frontend and the wallet #25

Why not add `and a_id <> 0` to the where clause of the function instead? Then we can leave it as plain SQL.