From 6a2c9b20b8cc17f812e92ef2f692ec360a21e569 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Tue, 4 Jun 2024 18:18:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/hdl/hdl_scheme.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/admin/hdl/hdl_scheme.go b/app/admin/hdl/hdl_scheme.go index 8b2b80a..af6df0e 100644 --- a/app/admin/hdl/hdl_scheme.go +++ b/app/admin/hdl/hdl_scheme.go @@ -43,13 +43,15 @@ func SchemeList(c *gin.Context) { e.OutErr(c, e.ERR_DB_ORM, err2.Error()) return } - temp.EnterpriseList = append(temp.EnterpriseList, struct { - Id int `json:"id"` - Name string `json:"name"` - }{ - Id: enterprise.Id, - Name: enterprise.Name, - }) + if enterprise != nil { + temp.EnterpriseList = append(temp.EnterpriseList, struct { + Id int `json:"id"` + Name string `json:"name"` + }{ + Id: enterprise.Id, + Name: enterprise.Name, + }) + } } result = append(result, &temp) }