mirror of
https://github.com/songquanpeng/message-pusher.git
synced 2025-09-27 04:26:31 +08:00
fix: fix IsShared check
This commit is contained in:
@@ -33,7 +33,8 @@ func (i *WeChatCorpAccountTokenStoreItem) Key() string {
|
|||||||
func (i *WeChatCorpAccountTokenStoreItem) IsShared() bool {
|
func (i *WeChatCorpAccountTokenStoreItem) IsShared() bool {
|
||||||
appId := fmt.Sprintf("%s|%s", i.CorpId, i.AgentId)
|
appId := fmt.Sprintf("%s|%s", i.CorpId, i.AgentId)
|
||||||
var count int64 = 0
|
var count int64 = 0
|
||||||
model.DB.Model(&model.Channel{}).Where("secret = ? and app_id = ? and type = ?", model.TypeWeChatCorpAccount, appId, i.AgentSecret).Count(&count)
|
model.DB.Model(&model.Channel{}).Where("secret = ? and app_id = ? and type = ?",
|
||||||
|
i.AgentSecret, appId, model.TypeWeChatCorpAccount).Count(&count)
|
||||||
return count > 1
|
return count > 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,7 +30,8 @@ func (i *WeChatTestAccountTokenStoreItem) Key() string {
|
|||||||
|
|
||||||
func (i *WeChatTestAccountTokenStoreItem) IsShared() bool {
|
func (i *WeChatTestAccountTokenStoreItem) IsShared() bool {
|
||||||
var count int64 = 0
|
var count int64 = 0
|
||||||
model.DB.Model(&model.Channel{}).Where("secret = ? and app_id = ? and type = ?", model.TypeWeChatTestAccount, i.AppID, i.AppSecret).Count(&count)
|
model.DB.Model(&model.Channel{}).Where("secret = ? and app_id = ? and type = ?",
|
||||||
|
i.AppSecret, i.AppID, model.TypeWeChatTestAccount).Count(&count)
|
||||||
return count > 1
|
return count > 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user