This commit is contained in:
jiangyong27 2025-04-22 11:28:16 +08:00
parent 7d316b13ec
commit 288b241fa0
1 changed files with 4 additions and 1 deletions

View File

@ -2,8 +2,10 @@ package api
import ( import (
"enterprise/common/model" "enterprise/common/model"
"fmt"
"github.com/smbrave/goutil" "github.com/smbrave/goutil"
"github.com/spf13/cast" "github.com/spf13/cast"
"time"
) )
type BaseRequest struct { type BaseRequest struct {
@ -49,7 +51,8 @@ type Checkin struct {
func (c *Checkin) From(m *model.Checkin) { func (c *Checkin) From(m *model.Checkin) {
c.Id = cast.ToString(m.Id) c.Id = cast.ToString(m.Id)
c.Username = m.Username c.Username = m.Username
c.Day = m.Day dayTime, _ := time.ParseInLocation("2006-01-02", m.Day, time.Local)
c.Day = fmt.Sprintf("%s(%s)", c.Day, goutil.TimeToWeek(dayTime.Unix()))
c.Month = m.Month c.Month = m.Month
c.StartTime = goutil.TimeToDateTime(m.StartTime) c.StartTime = goutil.TimeToDateTime(m.StartTime)
c.EndTime = goutil.TimeToDateTime(m.EndTime) c.EndTime = goutil.TimeToDateTime(m.EndTime)