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 +}