From 0d109c7a199936d7b4f190e8d17267f12fd9a784 Mon Sep 17 00:00:00 2001 From: jhc <9316338+wangyitao309@user.noreply.gitee.com> Date: Wed, 28 Sep 2022 14:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.gitignore | 2 ++ cmd/controller/art_show.go | 3 --- cmd/dao/art_show.go | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.idea/.gitignore b/.idea/.gitignore index 35410ca..87a58f6 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml + +/conf diff --git a/cmd/controller/art_show.go b/cmd/controller/art_show.go index 71c2ad9..fa9d92c 100644 --- a/cmd/controller/art_show.go +++ b/cmd/controller/art_show.go @@ -85,9 +85,6 @@ func (p *ArtShowProvider) ShowList(ctx context.Context, req *artShow.ShowListReq if req.PageSize == 0 { req.Page = 10 } - if req.IsShow == 0 { - req.IsShow = m.ARTSHOW_INSIDE - } res = new(artShow.ShowListRes) err, res = service.ArtShowList(req) if err != nil { diff --git a/cmd/dao/art_show.go b/cmd/dao/art_show.go index a9354b2..a9c7cfd 100644 --- a/cmd/dao/art_show.go +++ b/cmd/dao/art_show.go @@ -32,7 +32,9 @@ func ArtShowList(in *artShow.ShowListReq) (err error, total int64, out []*model. if in.StartTime != "" && in.EndTime != "" { queryDB = queryDB.Where("convert(show_time, date) between ? and ?", in.StartTime, in.EndTime) } - queryDB = queryDB.Where("is_show = ?", in.IsShow) + if in.IsShow != 0 { + queryDB = queryDB.Where("is_show = ?", in.IsShow) + } err = queryDB.Count(&total).Error if err != nil {