@@ -8,4 +8,5 @@ type AppletApplicationDao interface { | |||||
GetAppletApplicationListByAppid(appId string) (medium *model.AppletApplication, err error) | 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) | FindAppletApplicationList(name, platform string, state []string, mediumId, page, limit int) (list []model.AppletApplication, total int64, err error) | ||||
FindAllAppletApplicationList() (list []model.AppletApplication, err error) | FindAllAppletApplicationList() (list []model.AppletApplication, err error) | ||||
FindAllAppletApplicationListByMediumId(mediumId string) (list []model.AppletApplication, err error) | |||||
} | } |
@@ -47,7 +47,7 @@ func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceList(name, p | |||||
sess.Limit(limit, (page-1)*limit) | sess.Limit(limit, (page-1)*limit) | ||||
} | } | ||||
if mediumId != "" { | 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 != "" { | if name != "" { | ||||
sess.And("applet_application_ad_space_list.name like ? or applet_application_ad_space_list.ad_id like ?", "%"+name+"%", "%"+name+"%") | sess.And("applet_application_ad_space_list.name like ? or applet_application_ad_space_list.ad_id like ?", "%"+name+"%", "%"+name+"%") | ||||
@@ -4,6 +4,7 @@ import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/dao" | "code.fnuoos.com/zhimeng/model.git/src/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/model" | "code.fnuoos.com/zhimeng/model.git/src/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | ||||
"strings" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -79,3 +80,14 @@ func (a AppletApplicationDb) FindAllAppletApplicationList() (list []model.Applet | |||||
} | } | ||||
return | 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 | |||||
} |