From 33ea9c4c90f2d6d1e6daf91d155e4466c693da89 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 26 Nov 2024 10:15:50 +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/dao/applet_application_dao.go | 1 + .../applet_application_ad_space_list_implement.go | 2 +- src/implement/applet_application_implement.go | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/dao/applet_application_dao.go b/src/dao/applet_application_dao.go index 313b8fd..6a51af6 100644 --- a/src/dao/applet_application_dao.go +++ b/src/dao/applet_application_dao.go @@ -8,4 +8,5 @@ type AppletApplicationDao interface { GetAppletApplicationListByAppid(appId string) (medium *model.AppletApplication, err error) FindAppletApplicationList(name, platform string, state []string, mediumId, page, limit int) (list []model.AppletApplication, total int64, err error) FindAllAppletApplicationList() (list []model.AppletApplication, err error) + FindAllAppletApplicationListByMediumId(mediumId string) (list []model.AppletApplication, err error) } diff --git a/src/implement/applet_application_ad_space_list_implement.go b/src/implement/applet_application_ad_space_list_implement.go index b323eb5..afeabdd 100644 --- a/src/implement/applet_application_ad_space_list_implement.go +++ b/src/implement/applet_application_ad_space_list_implement.go @@ -47,7 +47,7 @@ func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceList(name, p sess.Limit(limit, (page-1)*limit) } if mediumId != "" { - sess.And("applet_application_ad_space_list.medium_id=?", strings.Split(mediumId, ",")) + sess.In("applet_application_ad_space_list.medium_id", strings.Split(mediumId, ",")) } if name != "" { sess.And("applet_application_ad_space_list.name like ? or applet_application_ad_space_list.ad_id like ?", "%"+name+"%", "%"+name+"%") diff --git a/src/implement/applet_application_implement.go b/src/implement/applet_application_implement.go index 05fd304..313b901 100644 --- a/src/implement/applet_application_implement.go +++ b/src/implement/applet_application_implement.go @@ -4,6 +4,7 @@ import ( "code.fnuoos.com/zhimeng/model.git/src/dao" "code.fnuoos.com/zhimeng/model.git/src/model" zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" + "strings" "xorm.io/xorm" ) @@ -79,3 +80,14 @@ func (a AppletApplicationDb) FindAllAppletApplicationList() (list []model.Applet } return } +func (a AppletApplicationDb) FindAllAppletApplicationListByMediumId(mediumId string) (list []model.AppletApplication, err error) { + sess := a.Db.Desc("id") + if mediumId != "" { + sess.In("medium_id", strings.Split(mediumId, ",")) + } + err = sess.Find(&list) + if err != nil { + return nil, err + } + return +}