接口对接

This commit is contained in:
2026-04-21 13:31:10 +08:00
parent adb6da1d70
commit 33cb945846
8 changed files with 119 additions and 47 deletions

View File

@@ -85,11 +85,17 @@ func (d *anchorDao) buildListFilter(ctx context.Context, req *dto.ListAnchorReq)
WhereOrLike(entity.AnchorCols.Phone, "%"+req.Keyword+"%").
WhereOrLike(entity.AnchorCols.Code, "%"+req.Keyword+"%")
}
model.Where(entity.AnchorCols.Name, req.Name)
model.Where(entity.AnchorCols.Phone, req.Phone)
model.Where(entity.AnchorCols.Code, req.Code)
if !g.IsEmpty(req.Name) {
model.WhereLike(entity.AnchorCols.Name, "%"+req.Name+"%")
}
if !g.IsEmpty(req.Phone) {
model.WhereLike(entity.AnchorCols.Phone, "%"+req.Phone+"%")
}
if !g.IsEmpty(req.Code) {
model.WhereLike(entity.AnchorCols.Code, "%"+req.Code+"%")
}
if req.Status != nil {
model.Where(entity.AnchorCols.Status, *req.Status)
model.Where("status = ?", *req.Status)
}
model.OmitEmptyWhere()
return model