|
|
@@ -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 |
|
|
|
} |