Browse Source

更新

master
huangjiajun 6 months ago
parent
commit
d8881ac08a
2 changed files with 21 additions and 0 deletions
  1. +16
    -0
      db/model/task_video_num.go
  2. +5
    -0
      hdl/hdl_condition.go

+ 16
- 0
db/model/task_video_num.go View File

@@ -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 View File

@@ -392,3 +392,8 @@ func TotalSmallTeam(eg *xorm.Engine, uid string) string {
} }
return "0" 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)
}

Loading…
Cancel
Save