This commit is contained in:
jiangyong 2024-04-28 00:03:57 +08:00
parent cef4bac1f9
commit eb1823486b
2 changed files with 3 additions and 0 deletions

View File

@ -7,4 +7,5 @@ type Nowcar struct {
Workstation string Workstation string
StartTime int64 StartTime int64
EndTime int64 EndTime int64
Amount int64
} }

View File

@ -88,6 +88,8 @@ func getInfo(devId string) ([]string, error) {
} }
m2.EndTime = time.Now().Unix() m2.EndTime = time.Now().Unix()
m2.Amount = goutil.If(m2.EndTime-m2.StartTime <= 600, 660,
60*(m2.EndTime-m2.StartTime-600)+660)
err = dao.NewNowCarDao().Update(m2) err = dao.NewNowCarDao().Update(m2)
if err != nil { if err != nil {
log.Errorf("db error :%s", err.Error()) log.Errorf("db error :%s", err.Error())