-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin_controller):新增管理员可以查询用户正方统一绑定状态的功能
- Loading branch information
1 parent
473755b
commit a80a6ad
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package adminServices | ||
|
||
import ( | ||
"wejh-go/app/models" | ||
"wejh-go/config/database" | ||
) | ||
|
||
func GetBindStatus(studentID string) (zfStatus, ouathStatus bool, err error) { | ||
var user models.User | ||
zfStatus = false | ||
ouathStatus = false | ||
result := database.DB.Model(models.User{}).Where("student_id = ?", studentID).First(&user) | ||
if result.Error != nil { | ||
return zfStatus, ouathStatus, result.Error | ||
} | ||
if user.ZFPassword != "" { | ||
zfStatus = true | ||
} | ||
if user.OauthPassword != "" { | ||
ouathStatus = true | ||
} | ||
return zfStatus, ouathStatus, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters