作者 唐旭辉

bug 修复

... ... @@ -2,6 +2,7 @@ package controllers
import (
"encoding/json"
"fmt"
"oppmg/common/log"
"oppmg/models"
"oppmg/protocol"
... ... @@ -32,15 +33,15 @@ func (c *AuditController) AuditList() {
msg = protocol.BadRequestParam("1")
return
}
beginTime, err := time.Parse("2006-01-02", param.CreateTimeBeginS)
beginTime, err := time.ParseInLocation("2006-01-02", param.CreateTimeBeginS, time.Local)
if err == nil && len(param.CreateTimeBeginS) > 0 {
param.CreateTimeBegin = beginTime.Unix()
}
endTime, err := time.Parse("2006-01-02", param.CreateTimeEndS)
endTime, err := time.ParseInLocation("2006-01-02", param.CreateTimeEndS, time.Local)
if err == nil && len(param.CreateTimeEndS) > 0 {
param.CreateTimeEnd = endTime.Unix() + 864399
param.CreateTimeEnd = endTime.Unix() + 86399
}
fmt.Println(err, param.CreateTimeBegin, param.CreateTimeEnd)
if len(param.StatusS) > 0 {
param.Status, _ = strconv.Atoi(param.StatusS)
}
... ...
... ... @@ -94,7 +94,7 @@ func buildSqlForAuditList(usercompanyid int64, companyid int64, userid int64) st
err error
)
//---------------------------------
if permissionObject, err = getAuditUserHasPermission(usercompanyid, userid); err != nil {
if permissionObject, err = getAuditUserHasPermission(userid, usercompanyid); err != nil {
unionsql = sql1 + " UNION " + sql2
return fmt.Sprintf(allsql, unionsql)
}
... ...
... ... @@ -528,6 +528,7 @@ func ValidUserPermission(urlPath string, userid int64, companyid int64) bool {
permissionObj, err = redisdata.GetUserPermission(userid, permissionbase.CodeName)
if err != nil {
//尝试从 数据库取权限 TODO
log.Error("未取到权限数据 err:%s", err)
return false
}
... ...