| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *AttendanceManageSearch) SetDate(date string) *AttendanceManageSearch { |
| | | slf.Date = date |
| | | return slf |
| | | } |
| | | |
| | | func (slf *AttendanceManageSearch) SetWorkerId(workerId string) *AttendanceManageSearch { |
| | | slf.WorkerId = workerId |
| | | return slf |
| | | } |
| | | |
| | | func (slf *AttendanceManageSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Table(slf.TableName()) |
| | | |
| | |
| | | db = db.Where("date like ?", slf.Month+"%") |
| | | } |
| | | |
| | | if slf.Date != "" { |
| | | db = db.Where("date = ?", slf.Date) |
| | | } |
| | | |
| | | if slf.WorkerId != "" { |
| | | db = db.Where("worker_id = ?", slf.WorkerId) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |