瀏覽代碼

update

master
shenjiachi 3 天之前
父節點
當前提交
9c0299d229
共有 2 個檔案被更改,包括 27 行新增1 行删除
  1. +5
    -1
      src/dao/advertising_callback_dao.go
  2. +22
    -0
      src/implement/advertising_callback_implement.go

+ 5
- 1
src/dao/advertising_callback_dao.go 查看文件

@@ -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 AdvertisingCallbackDao interface {
FindAdvertisingCallbackAndTotal(page, limit, amount, uid, startTime, endTime, platform, types string) (*[]model.AdvertisingCallback, int64, error)
AdvertisingCallbackExistBySession(session *xorm.Session, uid, startTime, endTime, types string) (bool, error)
}

+ 22
- 0
src/implement/advertising_callback_implement.go 查看文件

@@ -44,3 +44,25 @@ func (a AdvertisingCallbackDb) FindAdvertisingCallbackAndTotal(page, limit, amou
}
return &m, count, nil
}

func (a AdvertisingCallbackDb) AdvertisingCallbackExistBySession(session *xorm.Session, uid, startTime, endTime, types string) (bool, error) {
var m []model.AdvertisingCallback
sess := session.Where("1=1")
if uid != "" {
sess.And("uid=?", uid)
}
if types != "" {
sess.And("type=?", types)
}
if startTime != "" {
sess.And("create_at>=?", startTime)
}
if endTime != "" {
sess.And("create_at<=?", endTime)
}
exist, err := sess.Exist(&m)
if err != nil {
return false, err
}
return exist, nil
}

Loading…
取消
儲存