书写前端接口
This commit is contained in:
@@ -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})
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user