From 56b007c1b54877dd6a6c6777beca90844b94d109 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 25 Oct 2024 15:53:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/super/dao/generate_wx_ad_data_dao.go | 1 + .../generate_wx_ad_data_implement.go | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) 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 +}