@@ -8,7 +8,7 @@ type AppletApplicationAdSpaceList struct { | |||||
Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | Id int `json:"id" xorm:"not null pk autoincr INT(11)"` | ||||
Name string `json:"name" xorm:"default '' comment('广告位名称') VARCHAR(255)"` | Name string `json:"name" xorm:"default '' comment('广告位名称') VARCHAR(255)"` | ||||
AppId string `json:"app_id" xorm:"not null default '' comment('小程序appid') VARCHAR(255)"` | AppId string `json:"app_id" xorm:"not null default '' comment('小程序appid') VARCHAR(255)"` | ||||
Kind int `json:"kind" xorm:"not null default 1 comment('广告位类型(1:开屏广告 2:插屏广告 3:激励视频 4:信息流 5:Banner)') TINYINT(1)"` | |||||
Kind int `json:"kind" xorm:"not null default 1 comment('广告位类型(1:banner 2:激励视频 3:插屏广告 4:视频广告 5:视频贴片广告)') TINYINT(1)"` | |||||
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)"` | ||||
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"` | ||||
Update time.Time `json:"update" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | Update time.Time `json:"update" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"` | ||||
@@ -4,6 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type UserAppDomainDao interface { | type UserAppDomainDao interface { | ||||
GetUserAppDomain(masterId int) (m *model.UserAppDomain, err error) | GetUserAppDomain(masterId int) (m *model.UserAppDomain, err error) | ||||
GetMediumAppDomainByHost(host string) (m *model.UserAppDomain, err error) | |||||
GetAppDomainByHost(host string) (m *model.UserAppDomain, err error) | |||||
GetAppDomainByType(kind, masterId string) (m *model.UserAppDomain, err error) | |||||
UserAppDomainInsert(m *model.UserAppDomain) (int64, error) | UserAppDomainInsert(m *model.UserAppDomain) (int64, error) | ||||
} | } |
@@ -15,7 +15,7 @@ type UserAppDomainDb struct { | |||||
Db *xorm.Engine | Db *xorm.Engine | ||||
} | } | ||||
func (u UserAppDomainDb) GetMediumAppDomainByHost(host string) (m *model.UserAppDomain, err error) { | |||||
func (u UserAppDomainDb) GetAppDomainByHost(host string) (m *model.UserAppDomain, err error) { | |||||
m = new(model.UserAppDomain) | m = new(model.UserAppDomain) | ||||
has, err := u.Db.Where("domain =?", host).Get(m) | has, err := u.Db.Where("domain =?", host).Get(m) | ||||
if err != nil { | if err != nil { | ||||
@@ -27,6 +27,18 @@ func (u UserAppDomainDb) GetMediumAppDomainByHost(host string) (m *model.UserApp | |||||
return m, nil | return m, nil | ||||
} | } | ||||
func (u UserAppDomainDb) GetAppDomainByType(masterId, kind string) (m *model.UserAppDomain, err error) { | |||||
m = new(model.UserAppDomain) | |||||
has, err := u.Db.Where("type =?", kind).And("uuid =?", masterId).Get(m) | |||||
if err != nil { | |||||
return nil, zhios_order_relate_logx.Error(err) | |||||
} | |||||
if has == false { | |||||
return nil, nil | |||||
} | |||||
return m, nil | |||||
} | |||||
func (u UserAppDomainDb) GetUserAppDomain(masterId int) (m *model.UserAppDomain, err error) { | func (u UserAppDomainDb) GetUserAppDomain(masterId int) (m *model.UserAppDomain, err error) { | ||||
m = new(model.UserAppDomain) | m = new(model.UserAppDomain) | ||||
has, err := u.Db.Where("uuid =?", masterId).Get(m) | has, err := u.Db.Where("uuid =?", masterId).Get(m) | ||||