From 96821fc6268cef83fab38e2467d3141606b5523f Mon Sep 17 00:00:00 2001 From: chy <2463300564@qq.com> Date: Tue, 17 Jun 2025 14:27:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=B3=BB=E7=BB=9F=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E8=8E=B7=E5=8F=96=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=80=89=E6=8B=A9=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/logic/task/task.go | 10 +++++++++- internal/model/task.go | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/logic/task/task.go b/internal/logic/task/task.go index 26f2b24..9bd46da 100644 --- a/internal/logic/task/task.go +++ b/internal/logic/task/task.go @@ -236,7 +236,15 @@ func (s *sTask) GetSelectorList(ctx context.Context, in *model.SelectorIn) (out data := make([]model.SelectorOut, 0) err = dao.Merchants.Ctx(ctx).WithAll().Scan(&data) - + for i, v := range data { + for j, vv := range v.StoreDatas { + str, err := dao.Stores.Ctx(ctx).Fields("name").One(do.Stores{Id: vv.Id}) + if err != nil { + return nil, ecode.Fail.Sub("获取门店名称失败") + } + data[i].StoreDatas[j].StoreName = str.Map()["name"].(string) + } + } if err != nil { return nil, ecode.Fail.Sub("获取选择列表失败") } diff --git a/internal/model/task.go b/internal/model/task.go index b9ffa5c..a48e598 100644 --- a/internal/model/task.go +++ b/internal/model/task.go @@ -98,3 +98,7 @@ type StoreData struct { MerchantId int `json:"merchantId" orm:"merchant_id"` StoreName string `json:"storeName" orm:"name"` } + +type S struct { + Name string `json:"name"` +}