package model import ( "github.com/smbrave/goutil" "github.com/spf13/cast" "gitlab.batiao8.com/open/gosdk/qyweixin" "strings" "time" ) func (ac *ApprovalCheckin) From(d *qyweixin.ApproveDetail) { value := strings.SplitN(d.GetValue("补卡"), ",", 3) ac.SpNo = d.SpNo ac.Username = d.GetUserid() ac.ApplyTime = goutil.TimeToDateTime(d.ApplyTime) ac.CheckinRemark = d.GetValue("补卡事由") ac.CheckinDate = goutil.TimeToDate(cast.ToInt64(value[0])) ac.Month = time.Unix(cast.ToInt64(value[0]), 0).Format("200601") ac.CheckinTime = goutil.TimeToDateTime(cast.ToInt64(value[1])) ac.CheckinType = value[2] } type UsernameCount struct { Username string `json:"username"` Count int64 `json:"count"` } type ApprovalCheckin struct { Id int64 Username string Month string SpNo string CheckinType string CheckinDate string CheckinTime string CheckinRemark string ApplyTime string CreateTime int64 UpdateTime int64 }