From e81f81928f743938f434b374b70000371096aab9 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 13 Apr 2022 17:39:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=9C=E7=B4=A2=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/cloudbrain_image.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/cloudbrain_image.go b/models/cloudbrain_image.go index c3d86da09..c88db0f67 100644 --- a/models/cloudbrain_image.go +++ b/models/cloudbrain_image.go @@ -352,7 +352,7 @@ func SearchImageCondition(opts *SearchImageOptions) builder.Cond { } subQuery := builder.Select("image_topic_relation.image_id").From("image_topic_relation"). - Join("INNER", "image_topic", "image_topic.id = image_topic_relation.image_id"). + Join("INNER", "image_topic", "image_topic.id = image_topic_relation.topic_id"). Where(subQueryCond). GroupBy("image_topic_relation.image_id") var keywordCond = builder.In("id", subQuery) @@ -375,7 +375,7 @@ func SearchImageCondition(opts *SearchImageOptions) builder.Cond { subQueryCond = subQueryCond.Or(builder.Eq{"LOWER(image_topic.name)": strings.ToLower(v)}) subQuery := builder.Select("image_topic_relation.image_id").From("image_topic_relation"). - Join("INNER", "image_topic", "image_topic.id = image_topic_relation.image_id"). + Join("INNER", "image_topic", "image_topic.id = image_topic_relation.topic_id"). Where(subQueryCond). GroupBy("image_topic_relation.image_id") var topicCond = builder.In("id", subQuery)