作者 陈志颖

refactor:优化日志查看

... ... @@ -36,9 +36,9 @@ func main() {
}
}()
// excel文件路径映射
beego.SetStaticPath("/download", "download")
beego.SetStaticPath("/logs", "log")
//// excel文件路径映射
//beego.SetStaticPath("/download", "download")
//beego.SetStaticPath("/logs", "log")
beego.Run()
}
... ...
... ... @@ -102,7 +102,7 @@ func (repository *SuMoneyTransactionRecordRepository) Find(queryOptions map[stri
if uid, ok := queryOptions["uid"]; ok && (uid != int64(0)) {
query = query.Where(`su_money_transaction_record.employee @> '{"uid":?}'`, uid)
}
if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName.(string) != "") {
if employeeMatchName, ok := queryOptions["employeeMatchName"]; ok && (employeeMatchName != "") {
query = query.Where(`(su_money_transaction_record.employee->>'employeeName')::text LIKE ?`, fmt.Sprintf("%%%s%%", employeeMatchName.(string)))
}
if recordType, ok := queryOptions["recordType"]; ok && (recordType != 0) {
... ...
... ... @@ -3,6 +3,7 @@ package beego
import (
"github.com/astaxie/beego"
"github.com/linmadan/egglib-go/web/beego/filters"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/constant"
. "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/log"
"gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/middleware"
_ "gitlab.fjmaimaimai.com/linmadan/mmm-worth/pkg/port/beego/routers"
... ... @@ -20,4 +21,8 @@ func init() {
timeLocal, _ := time.LoadLocation("Asia/Chongqing")
time.Local = timeLocal
// excel文件路径映射
beego.SetStaticPath("/download", "download")
beego.SetStaticPath("/log", constant.LOG_File)
}
... ...