@@ -3,6 +3,7 @@ package dao | |||||
import "code.fnuoos.com/zhimeng/model.git/src/model" | import "code.fnuoos.com/zhimeng/model.git/src/model" | ||||
type AppletApplicationAdSpaceListDao interface { | type AppletApplicationAdSpaceListDao interface { | ||||
FindAppletApplicationAdSpaceListByMediumId(mediumId int) (medium *[]model.AppletApplicationAdSpaceList, err error) | |||||
FindAppletApplicationAdSpaceListByIds(id []string) (medium *[]model.AppletApplicationAdSpaceList, err error) | FindAppletApplicationAdSpaceListByIds(id []string) (medium *[]model.AppletApplicationAdSpaceList, err error) | ||||
FindAppletApplicationAdSpaceList(name, platform string, state string, mediumId, page, limit int) (list []AppletApplicationAdSpaceListGroup, total int64, err error) | FindAppletApplicationAdSpaceList(name, platform string, state string, mediumId, page, limit int) (list []AppletApplicationAdSpaceListGroup, total int64, err error) | ||||
} | } | ||||
@@ -23,6 +23,15 @@ func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceListByIds(id | |||||
} | } | ||||
return medium, nil | return medium, nil | ||||
} | } | ||||
func (a AppletApplicationAdSpaceListDb) FindAppletApplicationAdSpaceListByMediumId(mediumId int) (medium *[]model.AppletApplicationAdSpaceList, err error) { | |||||
medium = new([]model.AppletApplicationAdSpaceList) | |||||
err = a.Db.Where("medium_id=?", mediumId).Find(medium) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
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, 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") | sess := a.Db.Where("applet_application_ad_space_list.id>0").Desc("applet_application_ad_space_list.id") | ||||
if page > 0 { | if page > 0 { | ||||
@@ -11,6 +11,7 @@ type AppletApplicationAdSpaceList struct { | |||||
AdId string `json:"ad_id" xorm:"not null default '' comment('广告位id') VARCHAR(255)"` | AdId string `json:"ad_id" xorm:"not null default '' comment('广告位id') VARCHAR(255)"` | ||||
Kind string `json:"kind" xorm:"not null default '' comment('广告位类型(SLOT_ID_WEAPP_BANNER:banner SLOT_ID_WEAPP_REWARD_VIDEO:激励视频 SLOT_ID_WEAPP_INTERSTITIAL:插屏广告 SLOT_ID_WEAPP_VIDEO_FEEDS:视频广告 SLOT_ID_WEAPP_VIDEO_BEGIN:视频贴片广告)') VARCHAR(255)"` | Kind string `json:"kind" xorm:"not null default '' comment('广告位类型(SLOT_ID_WEAPP_BANNER:banner SLOT_ID_WEAPP_REWARD_VIDEO:激励视频 SLOT_ID_WEAPP_INTERSTITIAL:插屏广告 SLOT_ID_WEAPP_VIDEO_FEEDS:视频广告 SLOT_ID_WEAPP_VIDEO_BEGIN:视频贴片广告)') VARCHAR(255)"` | ||||
State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝 3:封禁中)') TINYINT(1)"` | State int `json:"state" xorm:"not null default 0 comment('状态(0:待审核 1:审核通过 2:审核拒绝 3:封禁中)') TINYINT(1)"` | ||||
UseState int `json:"use_state" xorm:"not null default 1 comment('广告位微信平台状态(1开通 2关闭)') TINYINT(1)"` | |||||
CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | CreateAt time.Time `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | UpdateAt time.Time `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
MediumId int `json:"medium_id" xorm:"not null comment('媒体id') default '0' INT(10)"` | MediumId int `json:"medium_id" xorm:"not null comment('媒体id') default '0' INT(10)"` | ||||