|
|
@@ -230,10 +230,11 @@ func (s *DtConfigService) Find(c *gin.Context) {
|
|
|
s.SetDbAlias("daytask")
|
|
|
type request[T any] struct {
|
|
|
base.ListRequest[T]
|
|
|
- Id *int64 `form:"id"`
|
|
|
- Group *string `form:"group"`
|
|
|
- Key *string `form:"key"`
|
|
|
- Name *string `form:"name"`
|
|
|
+ Id *int64 `form:"id"`
|
|
|
+ Group *string `form:"group"`
|
|
|
+ Key *string `form:"key"`
|
|
|
+ Name *string `form:"name"`
|
|
|
+ Status *int8 `form:"status"`
|
|
|
}
|
|
|
req := new(request[model.DtConfig])
|
|
|
if err := c.BindQuery(req); err != nil {
|
|
|
@@ -253,6 +254,9 @@ func (s *DtConfigService) Find(c *gin.Context) {
|
|
|
if req.Name != nil && *req.Name != "" {
|
|
|
db = db.Where("name LIKE ?", "%"+*req.Name+"%")
|
|
|
}
|
|
|
+ if req.Status != nil {
|
|
|
+ db = db.Where("status", req.Status)
|
|
|
+ }
|
|
|
db = db.Order("`group` ASC, sort ASC")
|
|
|
|
|
|
colInfo := s.GetColumnCommentFromStruct(model.DtConfig{})
|