diff --git a/src/model/applet_application_ad_space_list.go b/src/model/applet_application_ad_space_list.go index 4ccf038..c4de96b 100644 --- a/src/model/applet_application_ad_space_list.go +++ b/src/model/applet_application_ad_space_list.go @@ -9,7 +9,7 @@ type AppletApplicationAdSpaceList struct { Name string `json:"name" xorm:"default '' comment('广告位名称') 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)"` - 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)"` 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"` diff --git a/src/super/dao/medium_bank_info_dao.go b/src/super/dao/medium_bank_info_dao.go index 15a8da9..83e59be 100644 --- a/src/super/dao/medium_bank_info_dao.go +++ b/src/super/dao/medium_bank_info_dao.go @@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" type MediumBankInfoDao interface { 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 { model.MediumList `xorm:"extends"` diff --git a/src/super/dao/medium_contact_info_dao.go b/src/super/dao/medium_contact_info_dao.go index de27098..f15ae1e 100644 --- a/src/super/dao/medium_contact_info_dao.go +++ b/src/super/dao/medium_contact_info_dao.go @@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" type MediumContactInfoDao interface { 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 { model.MediumList `xorm:"extends"` diff --git a/src/super/dao/medium_list_dao.go b/src/super/dao/medium_list_dao.go index 23d47ae..04b77e1 100644 --- a/src/super/dao/medium_list_dao.go +++ b/src/super/dao/medium_list_dao.go @@ -6,5 +6,5 @@ type MediumListDao interface { GetMediumList(mediumId int) (medium *model.MediumList, err error) MediumListInsert(m *model.MediumList) (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) } diff --git a/src/super/implement/medium_bank_info_db.go b/src/super/implement/medium_bank_info_db.go index 8856b14..27becf7 100644 --- a/src/super/implement/medium_bank_info_db.go +++ b/src/super/implement/medium_bank_info_db.go @@ -26,7 +26,7 @@ func (a MediumBankInfoDb) GetMediumBankInfoList(MediumId int) (medium *model.Med } 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) if name != "" { sess.And("medium_list.company_name like ?", "%"+name+"%") @@ -34,6 +34,9 @@ func (a MediumBankInfoDb) FindMediumBankInfoList(name, state string, page, limit if 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") total, err = sess.FindAndCount(&list) if err != nil { diff --git a/src/super/implement/medium_contact_info_db.go b/src/super/implement/medium_contact_info_db.go index d8e0bfb..69968b3 100644 --- a/src/super/implement/medium_contact_info_db.go +++ b/src/super/implement/medium_contact_info_db.go @@ -26,7 +26,7 @@ func (a MediumContactInfoDb) GetMediumContactInfoList(MediumId int) (medium *mod } 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) if name != "" { sess.And("medium_list.company_name like ?", "%"+name+"%") @@ -34,6 +34,9 @@ func (a MediumContactInfoDb) FindMediumContactInfoList(name, state string, page, if 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") total, err = sess.FindAndCount(&list) if err != nil { diff --git a/src/super/implement/medium_list_implement.go b/src/super/implement/medium_list_implement.go index f73bdc4..716824e 100644 --- a/src/super/implement/medium_list_implement.go +++ b/src/super/implement/medium_list_implement.go @@ -42,7 +42,7 @@ func (m MediumListDb) UpdateMediumList(medium *model.MediumList, columns ...stri } 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) if name != "" { sess.And("company_name like ?", "%"+name+"%") @@ -50,6 +50,9 @@ func (m MediumListDb) FindMediumList(name, state string, page, limit int) (list if state != "" { sess.And("state = ?", state) } + if uuid != "" { + sess.And("uuid = ?", uuid) + } total, err = sess.FindAndCount(&list) if err != nil { return nil, 0, err