瀏覽代碼

广告位

master
huangjiajun 1 天之前
父節點
當前提交
15d0fb9f37
共有 2 個文件被更改,包括 12 次插入0 次删除
  1. +1
    -0
      src/dao/advertising_space_dao.go
  2. +11
    -0
      src/implement/advertising_space_implement.go

+ 1
- 0
src/dao/advertising_space_dao.go 查看文件

@@ -5,4 +5,5 @@ import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
type AdvertisingSpaceDao interface {
AdvertisingSpaceAll() (*[]model.AdvertisingSpace, error)
GetAdvertisingSpace(id string) (m *model.AdvertisingSpace, err error)
FindUserFeedbackCateAndTotal(page, limit string) (*[]model.AdvertisingSpace, int64, error)
}

+ 11
- 0
src/implement/advertising_space_implement.go 查看文件

@@ -3,6 +3,7 @@ package implement
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_utils "code.fnuoos.com/EggPlanet/egg_models.git/utils"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"xorm.io/xorm"
)
@@ -33,3 +34,13 @@ func (a AdvertisingSpaceDb) GetAdvertisingSpace(id string) (m *model.Advertising
}
return m, nil
}
func (a AdvertisingSpaceDb) FindUserFeedbackCateAndTotal(page, limit string) (*[]model.AdvertisingSpace, int64, error) {
var m []model.AdvertisingSpace
sess := a.Db.Where("1=1")
start := (zhios_order_relate_utils.StrToInt(page) - 1) * zhios_order_relate_utils.StrToInt(limit)
count, err := sess.Limit(zhios_order_relate_utils.StrToInt(limit), start).OrderBy("id desc").FindAndCount(&m)
if err != nil {
return nil, count, zhios_order_relate_logx.Error(err)
}
return &m, count, nil
}

Loading…
取消
儲存