replace NAME with USERNAME in recipe view

This commit is contained in:
Thomas Rubini 2023-01-17 09:51:16 +01:00
parent 78a1794c1a
commit 1f34989144
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ final class RecipeModel
$A_recipe["INGREDIENTS"] = $O_ingredientModel->searchByRecipe($A_recipe["ID"]);
$O_userModel = new UserModel();
$A_recipe["AUTHOR_NAME"] = $O_userModel->getNameByID($A_recipe["AUTHOR_ID"]);
$A_recipe["AUTHOR_USERNAME"] = $O_userModel->getUsernameByID($A_recipe["AUTHOR_ID"]);
$O_userModel = new DifficultyModel();
$A_recipe["DIFFICULTY_NAME"] = $O_userModel->getByID($A_recipe["DIFFICULTY_ID"]);

View File

@ -46,10 +46,10 @@ final class UserModel
return $row;
}
public function getNameByID($I_id)
public function getUsernameByID($I_id)
{
$O_model = Model::get();
$stmt = $O_model->prepare("SELECT NAME FROM USER WHERE ID=:id");
$stmt = $O_model->prepare("SELECT USERNAME FROM USER WHERE ID=:id");
$stmt->bindParam("id", $I_id);
$stmt->execute();