From d8881ac08a4c6f5a1c5522680eb9d32627e13f23 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 23 May 2024 14:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/model/task_video_num.go | 16 ++++++++++++++++ hdl/hdl_condition.go | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 db/model/task_video_num.go diff --git a/db/model/task_video_num.go b/db/model/task_video_num.go new file mode 100644 index 0000000..6a246a6 --- /dev/null +++ b/db/model/task_video_num.go @@ -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)"` +} diff --git a/hdl/hdl_condition.go b/hdl/hdl_condition.go index de6080d..de9158c 100644 --- a/hdl/hdl_condition.go +++ b/hdl/hdl_condition.go @@ -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 time0", uid, startTime, endTime, 3) + sum, _ := sess.Sum(&model.TaskVideoNum{}, "count") + return int(sum) +}