mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-10-16 13:01:00 +08:00
fix: 修复获取图片列表bug
This commit is contained in:
@@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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).
|
||||||
|
@@ -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/"
|
||||||
|
Reference in New Issue
Block a user