12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package controllers
- import (
- "bzd_server/conf"
- "bzd_server/lib"
- "bzd_server/models/System"
- beego "github.com/beego/beego/v2/server/web"
- "math"
- )
- type LogsController struct {
- beego.Controller
- }
- // 列表 -
- func (c *LogsController) List() {
- page, _ := c.GetInt("page")
- println(page)
- if page < 1 {
- page = 1
- }
- Class_1 := c.GetString("Class_1")
- c.Data["Class_1"] = Class_1
- c.Data["Class_List"] = System.Read_Logs_Class()
- var cnt int64
- c.Data["List"], cnt = System.Read_Logs_ALL(page, Class_1)
- page_size := math.Ceil(float64(cnt) / float64(conf.Page_size))
- c.Data["Page"] = page
- c.Data["Page_size"] = page_size
- c.Data["Pages"] = lib.Func_page(int64(page), int64(page_size))
- c.Data["cnt"] = cnt
- c.TplName = "System/Logs.html"
- }
- // 列表 -
- func (c *LogsController) UserLogs() {
- page, _ := c.GetInt("page")
- println(page)
- if page < 1 {
- page = 1
- }
- Class_1 := c.GetString("Class_1")
- c.Data["Class_1"] = Class_1
- c.Data["Class_List"] = System.Read_UserLogs_Class()
- var cnt int64
- c.Data["List"], cnt = System.Read_UserLogs_ALL(page, Class_1)
- page_size := math.Ceil(float64(cnt) / float64(conf.Page_size))
- c.Data["Page"] = page
- c.Data["Page_size"] = page_size
- c.Data["Pages"] = lib.Func_page(int64(page), int64(page_size))
- c.Data["cnt"] = cnt
- c.TplName = "User/UserLogs.html"
- }
|