修复bug
This commit is contained in:
+3
-8
@@ -551,7 +551,7 @@ func (that *MakeCode) Add(table string, req *http.Request) Map {
|
||||
//不可使用,未在前端展示,但在内存中保持有
|
||||
if v.GetBool("notUse") {
|
||||
if v.GetString("type") == "index" && that.TableColumns[table]["parent_id"] != nil {
|
||||
data[v.GetString("name")] = Slice{}
|
||||
data[v.GetString("name")] = ","
|
||||
}
|
||||
|
||||
continue
|
||||
@@ -593,7 +593,7 @@ func (that *MakeCode) Edit(table string, req *http.Request) Map {
|
||||
//不可使用,未在前端展示,但在内存中保持有
|
||||
if v.GetBool("notUse") {
|
||||
if v.GetString("type") == "index" && that.TableColumns[table]["parent_id"] != nil {
|
||||
data[v.GetString("name")] = Slice{}
|
||||
data[v.GetString("name")] = ","
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -626,17 +626,12 @@ func (that *MakeCode) Delete(table string, req *http.Request) Map {
|
||||
//不可使用,未在前端展示,但在内存中保持有
|
||||
if v.GetBool("notUse") {
|
||||
if v.GetString("type") == "index" && that.TableColumns[table]["parent_id"] != nil {
|
||||
data[v.GetString("name")] = Slice{}
|
||||
data[v.GetString("name")] = ","
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if len(data) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -21,7 +21,7 @@ var Project = Proj{
|
||||
this.Display(3, "参数不足")
|
||||
return
|
||||
}
|
||||
user := this.Db.Get("admin", "*", Map{"AND": Map{"name": name, "password": Md5(password)}})
|
||||
user := this.Db.Get("admin", "*", Map{"AND": Map{"OR":Map{"name": name,"phone":name}, "password": Md5(password)}})
|
||||
if user == nil {
|
||||
this.Display(5, "登录失败")
|
||||
return
|
||||
@@ -122,10 +122,13 @@ var {{table}}Ctr = Ctr{
|
||||
return
|
||||
}
|
||||
//索引管理,便于检索以及权限
|
||||
if inData.Get("parent_id") != nil && inData.GetSlice("index") != nil {
|
||||
if inData.Get("parent_id") != nil && inData.GetString("index") != "" {
|
||||
index := that.Db.Get(that.RouterString[1], "` + "`index`" + `", Map{"id": inData.Get("parent_id")})
|
||||
inData["index"] = index.GetString("index")+ObjToStr(re)+","
|
||||
that.Db.Update(that.RouterString[1],Map{"index":inData["index"]},Map{"id":re})
|
||||
}else if inData.GetString("index") != ""{
|
||||
inData["index"] = "," + ObjToStr(re) + ","
|
||||
that.Db.Update(that.RouterString[1], Map{"index": inData["index"]}, Map{"id": re})
|
||||
}
|
||||
|
||||
that.Display(0, re)
|
||||
@@ -138,7 +141,7 @@ var {{table}}Ctr = Ctr{
|
||||
}
|
||||
|
||||
//索引管理,便于检索以及权限
|
||||
if inData.Get("parent_id") != nil && inData.GetSlice("index") != nil {
|
||||
if inData.Get("parent_id") != nil && inData.GetString("index") != "" {
|
||||
Index := that.Db.Get(that.RouterString[1], "` + "`index`" + `", Map{"id": that.RouterString[2]})
|
||||
parentIndex := that.Db.Get(that.RouterString[1], "` + "`index`" + `", Map{"id": inData.Get("parent_id")})
|
||||
inData["index"] = parentIndex.GetString("index") + that.RouterString[2] + ","
|
||||
|
||||
Reference in New Issue
Block a user