|
|
@@ -26,7 +26,7 @@ func NewService(tenant string) Service {
|
|
|
}
|
|
|
|
|
|
// List 会议室列表
|
|
|
-func (s Service) List(req model.ListReq) ([]accountModel.SettleAccountBill, int, error) {
|
|
|
+func (s Service) List(req model.ListReq, user request.UserInfo) ([]accountModel.SettleAccountBill, int, error) {
|
|
|
entityModel := s.Dao.M
|
|
|
where := "1=1"
|
|
|
|
|
|
@@ -57,6 +57,9 @@ func (s Service) List(req model.ListReq) ([]accountModel.SettleAccountBill, int
|
|
|
if entity.StartDate != "" && entity.EndDate != "" {
|
|
|
where += fmt.Sprintf(" AND StartDate>'%v' AND EndDate<'%v'", entity.StartDate, entity.EndDate)
|
|
|
}
|
|
|
+ if entity.IsSelf != "1" { // 1 查看全部;其他 查看自己
|
|
|
+ where += fmt.Sprintf(" AND MainUserId='%v'", user.Id)
|
|
|
+ }
|
|
|
}
|
|
|
entityModel = entityModel.Where(where)
|
|
|
total, err := entityModel.Count()
|