框架优化

This commit is contained in:
hoteas
2022-03-13 17:02:19 +08:00
parent e426c285b0
commit cb0bcdb2d1
8 changed files with 96 additions and 66 deletions
+6 -3
View File
@@ -11,7 +11,8 @@ var TptProject = Proj{
"hotimeCommon": Ctr{
"info": func(that *Context) {
hotimeName := that.RouterString[0]
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(hotimeName + "_id").ToCeilInt()})
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
str, inData := that.MakeCodeRouter[hotimeName].Info(that.RouterString[1], data, that.Db)
where := Map{"id": that.RouterString[2]}
@@ -128,7 +129,9 @@ var TptProject = Proj{
"search": func(that *Context) {
hotimeName := that.RouterString[0]
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(hotimeName + "_id").ToCeilInt()})
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
columnStr, leftJoin, where := that.MakeCodeRouter[hotimeName].Search(that.RouterString[1], data, that.Req, that.Db)
@@ -220,7 +223,7 @@ var TptProject = Proj{
return
}
for k, v := range re {
column := that.MakeCodeRouter[hotimeName].TableColumns[hotimeName][k]
column := that.MakeCodeRouter[hotimeName].TableColumns[fileConfig.GetString("table")][k]
if column == nil {
continue
}