ソースを参照

update ad callback count by type prefix

master
shenjiachi 2日前
コミット
0d8e6dd68a
2個のファイルの変更6行の追加4行の削除
  1. +1
    -1
      src/dao/advertising_callback_dao.go
  2. +5
    -3
      src/implement/advertising_callback_implement.go

+ 1
- 1
src/dao/advertising_callback_dao.go ファイルの表示

@@ -6,6 +6,6 @@ import (

type AdvertisingCallbackDao interface {
FindAdvertisingCallbackAndTotal(page, limit, amount, uid, startTime, endTime, platform, types string) (*[]model.AdvertisingCallback, int64, error)
AdvertisingCallbackCount(uid, startTime, endTime, types string) (int64, error)
AdvertisingCallbackCount(uid, startTime, endTime, typePrefix string) (int64, error)
AdvertisingCallbackDeleteByDateByPage(date string, limit int) (int64, error)
}

+ 5
- 3
src/implement/advertising_callback_implement.go ファイルの表示

@@ -5,6 +5,7 @@ import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_utils "code.fnuoos.com/EggPlanet/egg_models.git/utils"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"fmt"
"xorm.io/xorm"
)

@@ -45,13 +46,14 @@ func (a AdvertisingCallbackDb) FindAdvertisingCallbackAndTotal(page, limit, amou
return &m, count, nil
}

func (a AdvertisingCallbackDb) AdvertisingCallbackCount(uid, startTime, endTime, types string) (int64, error) {
func (a AdvertisingCallbackDb) AdvertisingCallbackCount(uid, startTime, endTime, typePrefix string) (int64, error) {
sess := a.Db.Where("1=1")
if uid != "" {
sess.And("uid=?", uid)
}
if types != "" {
sess.And("type=?", types)
if typePrefix != "" {
types := fmt.Sprintf("type LIKE '%s'", typePrefix+"%")
sess.And(types)
}
if startTime != "" {
sess.And("create_at>=?", startTime)


読み込み中…
キャンセル
保存