书写前端接口

This commit is contained in:
hoteas
2021-12-12 04:22:30 +08:00
parent 7b85da4c7f
commit 9482404265
5 changed files with 77 additions and 17 deletions
+5 -5
View File
@@ -105,16 +105,16 @@ var productCtr = Ctr{
page = 1
}
if pageSize <= 0 {
pageSize = 20
pageSize = 10
}
leftJoin := Map{"[><]admin": "product.admin_id=admin.id"}
columnStr := "sn,name,img,count,used,saved,spot_check_saved,admin_id,admin.name AS admin_name,modify_time,state"
where := Map{"state": 0, "ORDER": "modify_time DESC"}
count := that.Db.Count("product", "id", where)
columnStr := "product.id,product.sn,product.name,product.img,product.count,product.used,product.saved,product.spot_check_count,product.admin_id,admin.name AS admin_name,product.modify_time,product.state"
where := Map{"ORDER": "modify_time DESC"}
count := that.Db.Count("product", where)
reData := that.Db.Page(page, pageSize).
PageSelect("product", leftJoin, columnStr, where)
that.Display(0, Map{"product": count, "data": reData})
that.Display(0, Map{"count": count, "data": reData})
},
}