فهرست منبع

Merge pull request #41 from leonardyp/leonardyp

fixed(*):  err  没有正确返回
tiger1103 4 سال پیش
والد
کامیت
e8ffc745a1
3فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  1. 1 1
      app/system/service/sys_dept.go
  2. 2 1
      app/system/service/sys_dict_type.go
  3. 4 3
      app/system/service/tools_gen_table.go

+ 1 - 1
app/system/service/sys_dept.go

@@ -68,7 +68,7 @@ func (s *dept) GetDeptListTree(pid int64, list []*model.SysDept) []*dao.SysDeptT
 				SysDept: v,
 			}
 			child := s.GetDeptListTree(v.DeptId, list)
-			if child != nil && len(child) > 0 {
+			if len(child) > 0 {
 				t.Children = child
 			}
 			tree = append(tree, t)

+ 2 - 1
app/system/service/sys_dict_type.go

@@ -7,6 +7,7 @@ import (
 	comService "gfast/app/common/service"
 	"gfast/app/system/dao"
 	"gfast/app/system/model"
+
 	"github.com/gogf/gf/container/garray"
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/errors/gerror"
@@ -101,7 +102,7 @@ func (s *sysDictType) Edit(ctx context.Context, req *model.SysDictTypeEditReq) e
 		//修改字段数据的类型
 		_, err = dao.SysDictData.TX(tx).Data(g.Map{dao.SysDictData.Columns.DictType: req.DictType}).
 			Where(dao.SysDictData.Columns.DictType, dt.DictType).Update()
-		return nil
+		return err
 	})
 	if err != nil {
 		g.Log().Debug(err)

+ 4 - 3
app/system/service/tools_gen_table.go

@@ -17,6 +17,10 @@ import (
 	comService "gfast/app/common/service"
 	"gfast/app/system/dao"
 	"gfast/app/system/model"
+	"io"
+	"os"
+	"strings"
+
 	"github.com/gogf/gf/database/gdb"
 	"github.com/gogf/gf/encoding/gjson"
 	"github.com/gogf/gf/errors/gerror"
@@ -27,9 +31,6 @@ import (
 	"github.com/gogf/gf/text/gregex"
 	"github.com/gogf/gf/text/gstr"
 	"github.com/gogf/gf/util/gconv"
-	"io"
-	"os"
-	"strings"
 )
 
 type toolsGenTable struct{}