Ver código fonte

公众号授权去重

zqwang 1 ano atrás
pai
commit
a34255da7c

+ 1 - 1
modules/WechatPlatform/Services/WechatKeywordsService.php

@@ -137,7 +137,7 @@ class WechatKeywordsService extends BaseService
         $list = DB::table('wechat_authorization_infos')
         $list = DB::table('wechat_authorization_infos')
             ->where('user_id', $userId)
             ->where('user_id', $userId)
             ->select('id', 'nick_name', 'is_enabled')->get();
             ->select('id', 'nick_name', 'is_enabled')->get();
-        $authList = WechatAccountKeywordLog::where('weacht_keyworld_id', $id)->get();
+        $authList = WechatAccountKeywordLog::where('weacht_keyworld_id', $id)->where('status' , 1)->distinct('appid')->get();
         if (!$list->isEmpty()) {
         if (!$list->isEmpty()) {
             foreach ($list as $val) {
             foreach ($list as $val) {
                 $val->is_auth = 0;
                 $val->is_auth = 0;

+ 1 - 1
modules/WechatPlatform/Services/WechatMenuService.php

@@ -141,7 +141,7 @@ class WechatMenuService extends BaseService
         $list = DB::table('wechat_authorization_infos')
         $list = DB::table('wechat_authorization_infos')
             ->where('user_id', $userId)
             ->where('user_id', $userId)
             ->select('id', 'nick_name', 'is_enabled')->get();
             ->select('id', 'nick_name', 'is_enabled')->get();
-        $authList = WechatAccountMenuDetail::where('menu_id', $id)->get();
+        $authList = WechatAccountMenuDetail::where('menu_id', $id)->where('status' , 1)->distinct('appid')->get();
         if (!$list->isEmpty()) {
         if (!$list->isEmpty()) {
             foreach ($list as $val) {
             foreach ($list as $val) {
                 $val->is_auth = 0;
                 $val->is_auth = 0;

+ 1 - 1
modules/WechatPlatform/Services/WechatSubscribeService.php

@@ -208,7 +208,7 @@ class WechatSubscribeService extends BaseService
         $list = DB::table('wechat_authorization_infos')
         $list = DB::table('wechat_authorization_infos')
             ->where('user_id', $userId)
             ->where('user_id', $userId)
             ->select('id', 'nick_name', 'is_enabled')->get();
             ->select('id', 'nick_name', 'is_enabled')->get();
-        $authList = WechatAccountSubscribeDetail::where('subscribe_id', $id)->get();
+        $authList = WechatAccountSubscribeDetail::where('subscribe_id', $id)->where('status' , 1)->distinct('appid')->get();
         if (!$list->isEmpty()) {
         if (!$list->isEmpty()) {
             foreach ($list as $val) {
             foreach ($list as $val) {
                 $val->is_auth = 0;
                 $val->is_auth = 0;