From 725e7331c9a835de51cda93b65bee3ea6784b065 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 25 Oct 2024 12:08:14 +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 | 4 ++-- src/super/implement/generate_wx_ad_data_implement.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/super/dao/generate_wx_ad_data_dao.go b/src/super/dao/generate_wx_ad_data_dao.go index 6b5e60a..a35ad4f 100644 --- a/src/super/dao/generate_wx_ad_data_dao.go +++ b/src/super/dao/generate_wx_ad_data_dao.go @@ -9,6 +9,6 @@ type GenerateWxAdDataDao interface { GenerateWxAdDataInsertBySession(session *xorm.Session, m *model.GenerateWxAdData) (int64, error) 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) + 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) } diff --git a/src/super/implement/generate_wx_ad_data_implement.go b/src/super/implement/generate_wx_ad_data_implement.go index 701c103..a813fdc 100644 --- a/src/super/implement/generate_wx_ad_data_implement.go +++ b/src/super/implement/generate_wx_ad_data_implement.go @@ -43,7 +43,7 @@ func (g GenerateWxAdDataDb) GenerateWxAdDataInsertBySession(session *xorm.Sessio } return insertAffected, nil } -func (g GenerateWxAdDataDb) FindGenerateWxAdDataList(uuid, appId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error) { +func (g GenerateWxAdDataDb) FindGenerateWxAdDataList(uuid, appId, mediumId, slotId, startDate, endDate string, page, limit int) (list []model.GenerateWxAdData, total int64, err error) { sess := g.Db.OrderBy("date desc,id desc").Limit(limit, (page-1)*limit) if uuid != "" { sess.And("uuid = ?", uuid) @@ -57,6 +57,9 @@ func (g GenerateWxAdDataDb) FindGenerateWxAdDataList(uuid, appId, slotId, startD 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, ",")) } @@ -66,7 +69,7 @@ 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) { +func (g GenerateWxAdDataDb) FindGenerateWxAdDataListMedium(uuid, appId, mediumId, 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) @@ -80,6 +83,9 @@ func (g GenerateWxAdDataDb) FindGenerateWxAdDataListMedium(uuid, appId, slotId, 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, ",")) }