package controllers import ( "ERP_user/conf" "ERP_user/models/Account" "ERP_user/models/System" "git.baozhida.cn/ERP_libs/lib" beego "github.com/beego/beego/v2/server/web" "math" ) type SysLogsController struct { beego.Controller User Account.User } func (c *SysLogsController) Prepare() { c.User = *Account.User_r } // 列表 - func (c *SysLogsController) List() { // 分页参数 初始化 page, _ := c.GetInt("page") if page < 1 { page = 1 } page_z, _ := c.GetInt("page_z") if page_z < 1 { page_z = conf.Page_size } // 查询 T_class := c.GetString("T_class") T_title := c.GetString("T_title") R_List, R_cnt := System.Read_SysLogs_List(T_class, T_title, page, page_z) var r_jsons lib.R_JSONS r_jsons.Num = R_cnt r_jsons.Data = R_List r_jsons.Page = page r_jsons.Page_size = int(math.Ceil(float64(R_cnt) / float64(page_z))) c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: r_jsons} c.ServeJSON() return } // 列表 - func (c *SysLogsController) List_DISTINCT_Class() { c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!", Data: System.Read_SysLogs_Class()} c.ServeJSON() return }