| @@ -352,7 +352,7 @@ func SearchImageCondition(opts *SearchImageOptions) builder.Cond { | |||||
| } | } | ||||
| subQuery := builder.Select("image_topic_relation.image_id").From("image_topic_relation"). | 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). | Where(subQueryCond). | ||||
| GroupBy("image_topic_relation.image_id") | GroupBy("image_topic_relation.image_id") | ||||
| var keywordCond = builder.In("id", subQuery) | 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)}) | subQueryCond = subQueryCond.Or(builder.Eq{"LOWER(image_topic.name)": strings.ToLower(v)}) | ||||
| subQuery := builder.Select("image_topic_relation.image_id").From("image_topic_relation"). | 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). | Where(subQueryCond). | ||||
| GroupBy("image_topic_relation.image_id") | GroupBy("image_topic_relation.image_id") | ||||
| var topicCond = builder.In("id", subQuery) | var topicCond = builder.In("id", subQuery) | ||||