|
|
@@ -32,7 +32,7 @@ func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceListByMedium |
|
|
|
} |
|
|
|
return medium, nil |
|
|
|
} |
|
|
|
func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceList(name, platform string, state string, mediumId, page, limit int) (list []dao.AppletApplicationAdSpaceListGroup, total int64, err error) { |
|
|
|
func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceList(name, platform string, adType, state string, mediumId, page, limit int) (list []dao.AppletApplicationAdSpaceListGroup, total int64, err error) { |
|
|
|
sess := a.Db.Where("applet_application_ad_space_list.id>0").Desc("applet_application_ad_space_list.id") |
|
|
|
if page > 0 { |
|
|
|
sess.Limit(limit, (page-1)*limit) |
|
|
@@ -46,6 +46,9 @@ func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceList(name, p |
|
|
|
if platform != "" { |
|
|
|
sess.And("applet_application.platform = ?", platform) |
|
|
|
} |
|
|
|
if adType != "" { |
|
|
|
sess.And("applet_application_ad_space_list.kind = ?", adType) |
|
|
|
} |
|
|
|
if state != "" { |
|
|
|
sess.And("applet_application_ad_space_list.state = ?", state) |
|
|
|
} |
|
|
@@ -56,3 +59,24 @@ func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceList(name, p |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func (a AppletApplicationAdSpaceListDb) GetAppletApplicationAdSpaceListByAdId(id string) (medium *model.AppletApplicationAdSpaceList, err error) { |
|
|
|
medium = new(model.AppletApplicationAdSpaceList) |
|
|
|
has, err := a.Db.Where("ad_id =?", id).Get(medium) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
if has == false { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
return medium, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (a AppletApplicationAdSpaceListDb) FindAllAppletApplicationAdSpaceListList(appId string) (list []model.AppletApplicationAdSpaceList, err error) { |
|
|
|
sess := a.Db.Where("app_id=?", appId).Desc("id") |
|
|
|
err = sess.Find(&list) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
return |
|
|
|
} |