add submenu
This commit is contained in:
parent
9b0f111f5b
commit
84f18b6141
5 changed files with 91 additions and 19 deletions
|
|
@ -224,6 +224,17 @@ func (rs *recipeService) GetRecipeOverview(request *contracts.RecipeOverviewRequ
|
|||
strings.Contains(strings.ToLower(v.OtherName), strings.ToLower(request.Search)) {
|
||||
searchResult = append(searchResult, v)
|
||||
}
|
||||
// do seach submenu
|
||||
if len(v.SubMenu) > 0 {
|
||||
for _, sub := range v.SubMenu {
|
||||
if strings.Contains(strings.ToLower(sub.ProductCode), strings.ToLower(request.Search)) ||
|
||||
strings.Contains(strings.ToLower(sub.Name), strings.ToLower(request.Search)) ||
|
||||
strings.Contains(strings.ToLower(sub.OtherName), strings.ToLower(request.Search)) {
|
||||
searchResult = append(searchResult, sub)
|
||||
// rs.taoLogger.Log.Debug("GetRecipeOverview.SubMenu", zap.Any("searchResult::GetSubMenu", sub))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
recipeFilter = searchResult
|
||||
}
|
||||
|
|
@ -253,6 +264,22 @@ func (rs *recipeService) GetRecipeOverview(request *contracts.RecipeOverviewRequ
|
|||
OtherDescription: v.OtherDescription,
|
||||
LastUpdated: v.LastChange,
|
||||
})
|
||||
|
||||
// submenu
|
||||
if len(v.SubMenu) > 0 {
|
||||
for _, sub := range v.SubMenu {
|
||||
result.Result = append(result.Result, contracts.RecipeOverview{
|
||||
ID: sub.ID,
|
||||
ProductCode: sub.ProductCode,
|
||||
Name: sub.Name,
|
||||
OtherName: sub.OtherName,
|
||||
Description: sub.Description,
|
||||
OtherDescription: sub.OtherDescription,
|
||||
LastUpdated: sub.LastChange,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
result.TotalCount = len(result.Result)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue