@@ -9,7 +9,7 @@ type AppletApplicationAdSpaceList struct { | |||||
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)"` | ||||
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 int `json:"kind" xorm:"not null default 1 comment('广告位类型(1:banner 2:激励视频 3:插屏广告 4:视频广告 5:视频贴片广告)') TINYINT(1)"` | |||||
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)"` | ||||
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"` | ||||
@@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type MediumBankInfoDao interface { | type MediumBankInfoDao interface { | ||||
GetMediumBankInfoList(MediumId int) (medium *model.MediumBankInfo, err error) | GetMediumBankInfoList(MediumId int) (medium *model.MediumBankInfo, err error) | ||||
FindMediumBankInfoList(name, state string, page, limit int) (list []MediumBankInfoGroup, total int64, err error) | |||||
FindMediumBankInfoList(uuid, name, state string, page, limit int) (list []MediumBankInfoGroup, total int64, err error) | |||||
} | } | ||||
type MediumBankInfoGroup struct { | type MediumBankInfoGroup struct { | ||||
model.MediumList `xorm:"extends"` | model.MediumList `xorm:"extends"` | ||||
@@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type MediumContactInfoDao interface { | type MediumContactInfoDao interface { | ||||
GetMediumContactInfoList(MediumId int) (medium *model.MediumContactInfo, err error) | GetMediumContactInfoList(MediumId int) (medium *model.MediumContactInfo, err error) | ||||
FindMediumContactInfoList(name, state string, page, limit int) (list []MediumContactInfoGroup, total int64, err error) | |||||
FindMediumContactInfoList(uuid, name, state string, page, limit int) (list []MediumContactInfoGroup, total int64, err error) | |||||
} | } | ||||
type MediumContactInfoGroup struct { | type MediumContactInfoGroup struct { | ||||
model.MediumList `xorm:"extends"` | model.MediumList `xorm:"extends"` | ||||
@@ -6,5 +6,5 @@ type MediumListDao interface { | |||||
GetMediumList(mediumId int) (medium *model.MediumList, err error) | GetMediumList(mediumId int) (medium *model.MediumList, err error) | ||||
MediumListInsert(m *model.MediumList) (int64, error) | MediumListInsert(m *model.MediumList) (int64, error) | ||||
UpdateMediumList(m *model.MediumList, columns ...string) (int64, error) | UpdateMediumList(m *model.MediumList, columns ...string) (int64, error) | ||||
FindMediumList(name, state string, page, limit int) (list []model.MediumList, total int64, err error) | |||||
FindMediumList(uuid, name, state string, page, limit int) (list []model.MediumList, total int64, err error) | |||||
} | } |
@@ -26,7 +26,7 @@ func (a MediumBankInfoDb) GetMediumBankInfoList(MediumId int) (medium *model.Med | |||||
} | } | ||||
return medium, nil | return medium, nil | ||||
} | } | ||||
func (a MediumBankInfoDb) FindMediumBankInfoList(name, state string, page, limit int) (list []dao.MediumBankInfoGroup, total int64, err error) { | |||||
func (a MediumBankInfoDb) FindMediumBankInfoList(uuid, name, state string, page, limit int) (list []dao.MediumBankInfoGroup, total int64, err error) { | |||||
sess := a.Db.Where("medium_bank_info.state>0").Desc("medium_bank_info.id").Limit(limit, (page-1)*limit) | sess := a.Db.Where("medium_bank_info.state>0").Desc("medium_bank_info.id").Limit(limit, (page-1)*limit) | ||||
if name != "" { | if name != "" { | ||||
sess.And("medium_list.company_name like ?", "%"+name+"%") | sess.And("medium_list.company_name like ?", "%"+name+"%") | ||||
@@ -34,6 +34,9 @@ func (a MediumBankInfoDb) FindMediumBankInfoList(name, state string, page, limit | |||||
if state != "" { | if state != "" { | ||||
sess.And("medium_bank_info.state = ?", state) | sess.And("medium_bank_info.state = ?", state) | ||||
} | } | ||||
if uuid != "" { | |||||
sess.And("medium_bank_info.uuid = ?", uuid) | |||||
} | |||||
sess.Join("LEFT", "medium_list", "medium_list.medium_id = medium_bank_info.medium_id") | sess.Join("LEFT", "medium_list", "medium_list.medium_id = medium_bank_info.medium_id") | ||||
total, err = sess.FindAndCount(&list) | total, err = sess.FindAndCount(&list) | ||||
if err != nil { | if err != nil { | ||||
@@ -26,7 +26,7 @@ func (a MediumContactInfoDb) GetMediumContactInfoList(MediumId int) (medium *mod | |||||
} | } | ||||
return medium, nil | return medium, nil | ||||
} | } | ||||
func (a MediumContactInfoDb) FindMediumContactInfoList(name, state string, page, limit int) (list []dao.MediumContactInfoGroup, total int64, err error) { | |||||
func (a MediumContactInfoDb) FindMediumContactInfoList(uuid, name, state string, page, limit int) (list []dao.MediumContactInfoGroup, total int64, err error) { | |||||
sess := a.Db.Where("medium_contact_info.state>0").Desc("medium_contact_info.id").Limit(limit, (page-1)*limit) | sess := a.Db.Where("medium_contact_info.state>0").Desc("medium_contact_info.id").Limit(limit, (page-1)*limit) | ||||
if name != "" { | if name != "" { | ||||
sess.And("medium_list.company_name like ?", "%"+name+"%") | sess.And("medium_list.company_name like ?", "%"+name+"%") | ||||
@@ -34,6 +34,9 @@ func (a MediumContactInfoDb) FindMediumContactInfoList(name, state string, page, | |||||
if state != "" { | if state != "" { | ||||
sess.And("medium_contact_info.state = ?", state) | sess.And("medium_contact_info.state = ?", state) | ||||
} | } | ||||
if uuid != "" { | |||||
sess.And("medium_contact_info.uuid = ?", uuid) | |||||
} | |||||
sess.Join("LEFT", "medium_list", "medium_list.medium_id = medium_contact_info.medium_id") | sess.Join("LEFT", "medium_list", "medium_list.medium_id = medium_contact_info.medium_id") | ||||
total, err = sess.FindAndCount(&list) | total, err = sess.FindAndCount(&list) | ||||
if err != nil { | if err != nil { | ||||
@@ -42,7 +42,7 @@ func (m MediumListDb) UpdateMediumList(medium *model.MediumList, columns ...stri | |||||
} | } | ||||
return affected, nil | return affected, nil | ||||
} | } | ||||
func (m MediumListDb) FindMediumList(name, state string, page, limit int) (list []model.MediumList, total int64, err error) { | |||||
func (m MediumListDb) FindMediumList(uuid, name, state string, page, limit int) (list []model.MediumList, total int64, err error) { | |||||
sess := m.Db.Where("state>0").Desc("id").Limit(limit, (page-1)*limit) | sess := m.Db.Where("state>0").Desc("id").Limit(limit, (page-1)*limit) | ||||
if name != "" { | if name != "" { | ||||
sess.And("company_name like ?", "%"+name+"%") | sess.And("company_name like ?", "%"+name+"%") | ||||
@@ -50,6 +50,9 @@ func (m MediumListDb) FindMediumList(name, state string, page, limit int) (list | |||||
if state != "" { | if state != "" { | ||||
sess.And("state = ?", state) | sess.And("state = ?", state) | ||||
} | } | ||||
if uuid != "" { | |||||
sess.And("uuid = ?", uuid) | |||||
} | |||||
total, err = sess.FindAndCount(&list) | total, err = sess.FindAndCount(&list) | ||||
if err != nil { | if err != nil { | ||||
return nil, 0, err | return nil, 0, err | ||||