feat: 环境管理页面添加环境名称模糊查询,统一双卡片布局
This commit is contained in:
@@ -18,8 +18,13 @@ func NewProfileHandler() *ProfileHandler {
|
||||
}
|
||||
|
||||
func (h *ProfileHandler) List(c *gin.Context) {
|
||||
alias := c.Query("alias")
|
||||
query := dao.Engine.Where("1=1")
|
||||
if alias != "" {
|
||||
query = query.Where("alias LIKE ?", "%"+alias+"%")
|
||||
}
|
||||
var profiles []model.Profile
|
||||
dao.Engine.Find(&profiles)
|
||||
query.Find(&profiles)
|
||||
c.JSON(http.StatusOK, model.WrapperResponse{Code: 0, Data: profiles})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user