- 菜谱查询返回创建都名字
This commit is contained in:
@@ -7,7 +7,8 @@ import (
|
||||
|
||||
type FoodRecipeWithAction struct {
|
||||
model.FoodRecipe
|
||||
ActionType int8 `json:"actionType"`
|
||||
AuthorName string `json:"authorName"`
|
||||
ActionType int8 `json:"actionType"`
|
||||
}
|
||||
|
||||
type FoodRecipeItemChoiceExt struct {
|
||||
@@ -29,9 +30,11 @@ func QueryFoodRecipes(db *DaoDB, keyword string, recipeID int, authorID, userID
|
||||
var sqlParams []interface{}
|
||||
if userID != "" {
|
||||
sql = `
|
||||
SELECT SQL_CALC_FOUND_ROWS t1.*, t2.action_type
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
t1.*, t2.action_type, t3.name author_name
|
||||
FROM food_recipe t1
|
||||
LEFT JOIN food_recipe_user t2 ON t2.recipe_id = t1.id AND t2.user_id = ? AND t2.deleted_at = ?
|
||||
LEFT user t3 ON t3.user_id = t1.author_id
|
||||
WHERE t1.deleted_at = ?`
|
||||
sqlParams = []interface{}{
|
||||
userID,
|
||||
|
||||
Reference in New Issue
Block a user