diff --git a/channel/wechat-corp-account.go b/channel/wechat-corp-account.go index 7f2802a..0bd3313 100644 --- a/channel/wechat-corp-account.go +++ b/channel/wechat-corp-account.go @@ -33,7 +33,8 @@ func (i *WeChatCorpAccountTokenStoreItem) Key() string { func (i *WeChatCorpAccountTokenStoreItem) IsShared() bool { appId := fmt.Sprintf("%s|%s", i.CorpId, i.AgentId) 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 } diff --git a/channel/wechat-test-account.go b/channel/wechat-test-account.go index 57a030c..2bdd59a 100644 --- a/channel/wechat-test-account.go +++ b/channel/wechat-test-account.go @@ -30,7 +30,8 @@ func (i *WeChatTestAccountTokenStoreItem) Key() string { func (i *WeChatTestAccountTokenStoreItem) IsShared() bool { 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 }