diff --git a/src/dao/advertising_function_dao.go b/src/dao/advertising_function_dao.go index 21b84df..9feb9aa 100644 --- a/src/dao/advertising_function_dao.go +++ b/src/dao/advertising_function_dao.go @@ -4,5 +4,6 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model" type AdvertisingFunctionDao interface { AdvertisingFunctionAll() (*[]model.AdvertisingFunction, error) + GetAdvertisingFunction(id string) (m *model.AdvertisingFunction, err error) FindUserFeedbackFunctionAndTotal(page, limit string) (*[]model.AdvertisingFunction, int64, error) } diff --git a/src/implement/advertising_function_implement.go b/src/implement/advertising_function_implement.go index 8d7ac72..75f4497 100644 --- a/src/implement/advertising_function_implement.go +++ b/src/implement/advertising_function_implement.go @@ -33,3 +33,14 @@ func (a AdvertisingFunctionDb) FindUserFeedbackFunctionAndTotal(page, limit stri } return &m, count, nil } +func (a AdvertisingFunctionDb) GetAdvertisingFunction(id string) (m *model.AdvertisingFunction, err error) { + m = new(model.AdvertisingFunction) + has, err := a.Db.Where("id=?", id).Get(m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, nil + } + return m, nil +}