huangjiajun pirms 4 dienas
vecāks
revīzija
fff8f11fce
2 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. +1
    -0
      src/dao/article_cate_dao.go
  2. +10
    -0
      src/implement/article_cate_implement.go

+ 1
- 0
src/dao/article_cate_dao.go Parādīt failu

@@ -9,4 +9,5 @@ type ArticleCateDao interface {
ArticleCateByPid(pid string) (*[]model.ArticleCate, error)
FindArticleCate(page, limit, pid string) (*[]model.ArticleCate, error)
FindArticleCateAndTotal(page, limit, pid string) (*[]model.ArticleCate, int64, error)
FindArticleCateAndTotalPid(page, limit string) (*[]model.ArticleCate, int64, error)
}

+ 10
- 0
src/implement/article_cate_implement.go Parādīt failu

@@ -60,3 +60,13 @@ func (a ArticleCateDb) FindArticleCateAndTotal(page, limit, pid string) (*[]mode
}
return &m, count, nil
}
func (a ArticleCateDb) FindArticleCateAndTotalPid(page, limit string) (*[]model.ArticleCate, int64, error) {
var m []model.ArticleCate
sess := a.Db.Where("pid>0")
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("sort desc,id desc").FindAndCount(&m)
if err != nil {
return nil, count, zhios_order_relate_logx.Error(err)
}
return &m, count, nil
}

Notiek ielāde…
Atcelt
Saglabāt