...
|
...
|
@@ -53,18 +53,21 @@ func (cmd *SearchEmployeeAttendanceQuery) Valid(validation *validation.Validatio |
|
|
cmd.Offset, cmd.Limit = domain.Pagination(cmd.PageNumber, cmd.PageSize)
|
|
|
var err error
|
|
|
if len(cmd.BeginTime) > 0 {
|
|
|
if cmd.SignBeginTime, err = time.Parse("2006-01-02 15:04:05", cmd.BeginTime); err != nil {
|
|
|
if cmd.SignBeginTime, err = time.ParseInLocation("2006-01-02 15:04:05", cmd.BeginTime, time.Local); err != nil {
|
|
|
log.Logger.Error(err.Error())
|
|
|
validation.Error("开始时间有误")
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if len(cmd.EndTime) > 0 {
|
|
|
if cmd.SignEndTime, err = time.Parse("2006-01-02 15:04:05", cmd.EndTime); err != nil {
|
|
|
if cmd.SignEndTime, err = time.ParseInLocation("2006-01-02 15:04:05", cmd.EndTime, time.Local); err != nil {
|
|
|
log.Logger.Error(err.Error())
|
|
|
validation.Error("结束时间有误")
|
|
|
return
|
|
|
}
|
|
|
if cmd.SignBeginTime.Equal(cmd.SignEndTime) {
|
|
|
cmd.SignEndTime = cmd.SignEndTime.Add(time.Hour * 24)
|
|
|
}
|
|
|
}
|
|
|
cmd.AttendanceStatus = 6 // 审核 + 自动审核
|
|
|
}
|
...
|
...
|
|