소스 검색

fix: fix IsShared check

JustSong 2 년 전
부모
커밋
00a9f02974
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 1
      channel/wechat-corp-account.go
  2. 2 1
      channel/wechat-test-account.go

+ 2 - 1
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
 }
 

+ 2 - 1
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
 }