fix: 修复获取图片列表bug

This commit is contained in:
tangtanglove
2023-04-01 10:41:35 +08:00
parent e19621b5c9
commit 05cea30fa9
3 changed files with 7 additions and 6 deletions

View File

@@ -70,7 +70,7 @@ func (p *Image) GetList(ctx *builder.Context) interface{} {
pagination := map[string]interface{}{ pagination := map[string]interface{}{
"defaultCurrent": 1, "defaultCurrent": 1,
"current": currentPage, "current": currentPage,
"pageSize": 12, "pageSize": 8,
"total": total, "total": total,
} }

View File

@@ -38,7 +38,11 @@ func (model *Picture) GetListBySearch(appKey string, tokenString string, categor
return pictures, 0, err return pictures, 0, err
} }
query := db.Client.Model(&Picture{}) query := db.Client.Model(&Picture{}).
Where("status =?", 1).
Where("obj_type = ?", "ADMINID").
Where("obj_id", adminInfo.Id)
if categoryId != "" { if categoryId != "" {
query.Where("picture_category_id =?", categoryId) query.Where("picture_category_id =?", categoryId)
} }
@@ -51,9 +55,6 @@ func (model *Picture) GetListBySearch(appKey string, tokenString string, categor
query.Count(&total) query.Count(&total)
query. query.
Where("status =?", 1).
Where("obj_type = ?", "ADMINID").
Where("obj_id", adminInfo.Id).
Order("id desc"). Order("id desc").
Limit(8). Limit(8).
Offset((page - 1) * 8). Offset((page - 1) * 8).

View File

@@ -19,7 +19,7 @@ const (
AppName = "QuarkGo" AppName = "QuarkGo"
// Version of current package // Version of current package
Version = "1.1.48" Version = "1.1.49"
// 静态文件URL // 静态文件URL
RespositoryURL = "https://github.com/quarkcms/quark-go/tree/main/website/" RespositoryURL = "https://github.com/quarkcms/quark-go/tree/main/website/"