|
|
@@ -42,8 +42,8 @@ func (s Service) List(req model.ListReq) ([]model.List, int, error) {
|
|
|
if entity.EntityId != 0 {
|
|
|
entityModel = entityModel.Where(s.Dao.Columns.EntityId, entity.EntityId)
|
|
|
}
|
|
|
- if entity.UserId != 0 {
|
|
|
- entityModel = entityModel.Where(s.Dao.Columns.UserId, entity.UserId)
|
|
|
+ if entity.UserName != "" {
|
|
|
+ entityModel = entityModel.WhereLike(s.Dao.Columns.UserName, "%"+entity.UserName+"%")
|
|
|
}
|
|
|
// 预约状态(1:预定 2:取消)
|
|
|
if entity.Status != 0 {
|
|
|
@@ -267,6 +267,9 @@ func (s Service) getCurrentWeekReservation(ctx context.Context, req model.Reserv
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
+ if len(list) == 0 {
|
|
|
+ return nil, nil
|
|
|
+ }
|
|
|
uIds := make([]int64, 0)
|
|
|
uMap := make(map[int]struct{})
|
|
|
for _, v := range list {
|