fix: RIGHT join is not support in sqlite3, use LEFT instead.

This commit is contained in:
LinkinStar 2022-10-26 14:11:50 +08:00
parent 2870ba8922
commit f248a52980
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ func (qr *questionRepo) SearchList(ctx context.Context, search *schema.QuestionS
session := qr.data.DB.Table("question")
if len(search.TagIDs) > 0 {
session = session.Join("RIGHT", "tag_rel", "question.id = tag_rel.object_id")
session = session.Join("LEFT", "tag_rel", "question.id = tag_rel.object_id")
session = session.And("tag_rel.tag_id =?", search.TagIDs[0])
//session = session.In("tag_rel.tag_id ", search.TagIDs)
session = session.And("tag_rel.status =?", entity.TagRelStatusAvailable)