Browse Source

短剧短视频观看数量

master^2
huangjiajun 16 hours ago
parent
commit
a224ec092e
4 changed files with 33 additions and 2 deletions
  1. +5
    -1
      src/dao/playlet_total_dao.go
  2. +5
    -1
      src/dao/video_total_dao.go
  3. +12
    -0
      src/implement/playlet_total_implement.go
  4. +11
    -0
      src/implement/video_total_implement.go

+ 5
- 1
src/dao/playlet_total_dao.go View File

@@ -1,7 +1,11 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"xorm.io/xorm"
)

type PlayletTotalDao interface {
GetPlayletTotal(uid, date string) (m *model.PlayletTotal, err error)
GetPlayletTotalSess(sess *xorm.Session, uid, date string) (m *model.PlayletTotal, err error)
}

+ 5
- 1
src/dao/video_total_dao.go View File

@@ -1,7 +1,11 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"xorm.io/xorm"
)

type VideoTotalDao interface {
GetVideoTotal(uid, date string) (m *model.VideoTotal, err error)
GetVideoTotalSess(sess *xorm.Session, uid, date string) (m *model.VideoTotal, err error)
}

+ 12
- 0
src/implement/playlet_total_implement.go View File

@@ -26,3 +26,15 @@ func (p PlayletTotalDb) GetPlayletTotal(uid, date string) (m *model.PlayletTotal
}
return m, nil
}

func (p PlayletTotalDb) GetPlayletTotalSess(sess *xorm.Session, uid, date string) (m *model.PlayletTotal, err error) {
m = new(model.PlayletTotal)
has, err := sess.Where("uid=? and date=?", uid, date).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

+ 11
- 0
src/implement/video_total_implement.go View File

@@ -26,3 +26,14 @@ func (v VideoTotalDb) GetVideoTotal(uid, date string) (m *model.VideoTotal, err
}
return m, nil
}
func (v VideoTotalDb) GetVideoTotalSess(sess *xorm.Session, uid, date string) (m *model.VideoTotal, err error) {
m = new(model.VideoTotal)
has, err := sess.Where("uid=? and date=?", uid, date).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

Loading…
Cancel
Save