瀏覽代碼

更新

master
huangjiajun 4 週之前
父節點
當前提交
6c5d31eb74
共有 2 個文件被更改,包括 24 次插入0 次删除
  1. +1
    -0
      src/super/dao/generate_wx_ad_data_dao.go
  2. +23
    -0
      src/super/implement/generate_wx_ad_data_implement.go

+ 1
- 0
src/super/dao/generate_wx_ad_data_dao.go 查看文件

@@ -10,4 +10,5 @@ type GenerateWxAdDataDao interface {
GetGenerateWxAdData(id int) (data *model.GenerateWxAdData, err error)
UpdateGenerateWxAdDataBySession(session *xorm.Session, m *model.GenerateWxAdData, columns ...string) (int64, error)
FindGenerateWxAdDataList(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error)
FindGenerateWxAdDataListMedium(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error)
}

+ 23
- 0
src/super/implement/generate_wx_ad_data_implement.go 查看文件

@@ -66,3 +66,26 @@ func (g GenerateWxAdDataDb) FindGenerateWxAdDataList(uuid, appId, slotId, startD
}
return
}
func (g GenerateWxAdDataDb) FindGenerateWxAdDataListMedium(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error) {
sess := g.Db.Where("is_generate_report=1").OrderBy("date desc,id desc").Limit(limit, (page-1)*limit)
if uuid != "" {
sess.And("uuid = ?", uuid)
}
if startDate != "" {
sess.And("date>=", startDate)
}
if endDate != "" {
sess.And("date<=", endDate)
}
if appId != "" {
sess.In("app_id", strings.Split(appId, ","))
}
if slotId != "" {
sess.In("slot_id", strings.Split(slotId, ","))
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}

Loading…
取消
儲存