fix: fix IsShared implementation

This commit is contained in:
JustSong
2023-05-06 11:49:56 +08:00
parent 3e51538fdf
commit 581d9d62dc
4 changed files with 10 additions and 5 deletions
+3 -2
View File
@@ -29,8 +29,9 @@ func (i *WeChatTestAccountTokenStoreItem) Key() string {
}
func (i *WeChatTestAccountTokenStoreItem) IsShared() bool {
return model.DB.Where("type = ? and app_id = ? and secret = ?",
model.TypeWeChatTestAccount, i.AppID, i.AppSecret).Find(&model.Channel{}).RowsAffected != 1
var count int64 = 0
model.DB.Model(&model.Channel{}).Where("type = ? and app_id = ? and secret = ?", model.TypeWeChatTestAccount, i.AppID, i.AppSecret).Count(&count)
return count > 1
}
func (i *WeChatTestAccountTokenStoreItem) IsFilled() bool {