From 943687bef8c444cad060ac4cce49fb47afd1b97a Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 29 Jan 2024 18:13:28 +0800 Subject: [PATCH] update --- app/admin/hdl/hdl_suggested_feedback.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/admin/hdl/hdl_suggested_feedback.go b/app/admin/hdl/hdl_suggested_feedback.go index 9cbd63c..420c641 100644 --- a/app/admin/hdl/hdl_suggested_feedback.go +++ b/app/admin/hdl/hdl_suggested_feedback.go @@ -1,8 +1,10 @@ package hdl import ( + enum2 "applet/app/admin/enum" "applet/app/admin/lib/validate" "applet/app/admin/md" + "applet/app/admin/svc" "applet/app/db" "applet/app/e" "github.com/gin-gonic/gin" @@ -38,6 +40,25 @@ func SuggestedFeedbackList(c *gin.Context) { if req.Phone != "" { sess.And("user.phone like ?", "%"+req.Phone+"%") } + + admin := svc.GetUser(c) + if admin.IsSuperAdministrator != enum2.IsSuperAdministratorTure { + adminWithEnterpriseDb := db.AdminWithEnterpriseDb{} + adminWithEnterpriseDb.Set() + adminWithEnterprise, err1 := adminWithEnterpriseDb.FindAdminWithEnterprise(admin.AdmId) + if err1 != nil { + e.OutErr(c, e.ERR_DB_ORM, err1.Error()) + return + } + var enterPriseIds []int + for _, v1 := range *adminWithEnterprise { + enterPriseIds = append(enterPriseIds, v1.EnterpriseId) + } + if len(enterPriseIds) == 0 { + return + } + sess.In("device.enterprise_id", enterPriseIds) + } var m []*db.SuggestedFeedbackWithUserIdentity count, err := sess.