huangjiajun pirms 6 mēnešiem
vecāks
revīzija
d8881ac08a
2 mainītis faili ar 21 papildinājumiem un 0 dzēšanām
  1. +16
    -0
      db/model/task_video_num.go
  2. +5
    -0
      hdl/hdl_condition.go

+ 16
- 0
db/model/task_video_num.go Parādīt failu

@@ -0,0 +1,16 @@
package model

import (
"time"
)

type TaskVideoNum struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int `json:"uid" xorm:"default 0 INT(11)"`
Time int `json:"time" xorm:"default 0 INT(11)"`
InviteTime time.Time `json:"invite_time" xorm:"DATETIME"`
ParentUid int `json:"parent_uid" xorm:"default 0 INT(11)"`
Count int `json:"count" xorm:"default 0 INT(11)"`
TaskId int `json:"task_id" xorm:"default 0 INT(11)"`
TaskType int `json:"task_type" xorm:"default 0 INT(11)"`
}

+ 5
- 0
hdl/hdl_condition.go Parādīt failu

@@ -392,3 +392,8 @@ func TotalSmallTeam(eg *xorm.Engine, uid string) string {
}
return "0"
}
func GetOwnTaskVideoNum(eg *xorm.Engine, uid, startTime, endTime string) int {
sess := eg.Where("uid=? and time>=? and time<? and task_type=? and task_id>0", uid, startTime, endTime, 3)
sum, _ := sess.Sum(&model.TaskVideoNum{}, "count")
return int(sum)
}

Notiek ielāde…
Atcelt
Saglabāt