From a2a9731dce2f8d3d291fa359fb0dc4b014da14a3 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sun, 1 Oct 2023 17:44:00 +0800 Subject: [PATCH] fixed get user profile error when this user not have tweets yet --- internal/dao/jinzhu/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dao/jinzhu/user.go b/internal/dao/jinzhu/user.go index 0d082a8a..6f5c2c71 100644 --- a/internal/dao/jinzhu/user.go +++ b/internal/dao/jinzhu/user.go @@ -36,7 +36,7 @@ func newUserManageService(db *gorm.DB, ums core.UserMetricServantA) core.UserMan return &userManageSrv{ db: db, ums: ums, - _userProfileJoins: fmt.Sprintf("JOIN %s m ON %s.id=m.user_id", _userMetric_, _user_), + _userProfileJoins: fmt.Sprintf("LEFT JOIN %s m ON %s.id=m.user_id", _userMetric_, _user_), _userProfileWhere: fmt.Sprintf("%s.username=? AND %s.is_del=0", _user_, _user_), _userProfileColoumns: []string{ fmt.Sprintf("%s.id", _user_),