daywwek
This commit is contained in:
parent
7d316b13ec
commit
288b241fa0
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue