diff --git a/src/super/dao/generate_wx_ad_data_dao.go b/src/super/dao/generate_wx_ad_data_dao.go index a35ad4f..ac66eeb 100644 --- a/src/super/dao/generate_wx_ad_data_dao.go +++ b/src/super/dao/generate_wx_ad_data_dao.go @@ -11,4 +11,5 @@ type GenerateWxAdDataDao interface { UpdateGenerateWxAdDataBySession(session *xorm.Session, m *model.GenerateWxAdData, columns ...string) (int64, error) FindGenerateWxAdDataList(uuid, appId, mediumId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error) FindGenerateWxAdDataListMedium(uuid, appId, mediumId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error) + FindGenerateWxAdDataListMediumAll(uuid, appId, mediumId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, err error) } diff --git a/src/super/implement/generate_wx_ad_data_implement.go b/src/super/implement/generate_wx_ad_data_implement.go index a813fdc..7bf768c 100644 --- a/src/super/implement/generate_wx_ad_data_implement.go +++ b/src/super/implement/generate_wx_ad_data_implement.go @@ -95,3 +95,29 @@ func (g GenerateWxAdDataDb) FindGenerateWxAdDataListMedium(uuid, appId, mediumId } return } +func (g GenerateWxAdDataDb) FindGenerateWxAdDataListMediumAll(uuid, appId, mediumId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, 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 mediumId != "" { + sess.In("medium_id", strings.Split(mediumId, ",")) + } + if slotId != "" { + sess.In("slot_id", strings.Split(slotId, ",")) + } + err = sess.Find(&list) + if err != nil { + return nil, err + } + return +}