Browse Source

advertise

tusx 6 years ago
parent
commit
7389f361a4
1 changed files with 8 additions and 3 deletions
  1. 8 3
      app/Http/Controllers/Wap/User/CoflController.php

+ 8 - 3
app/Http/Controllers/Wap/User/CoflController.php

@@ -312,9 +312,14 @@ class CoflController extends Controller
         $inner_channels = Channel::join('channel_users','channel_users.id','=','distribution_channels.channel_user_id')
         $inner_channels = Channel::join('channel_users','channel_users.id','=','distribution_channels.channel_user_id')
             ->select('distribution_channels.id')
             ->select('distribution_channels.id')
             ->whereIn('channel_users.id',explode(',',redisEnv('PROMOTION_GROUP_CHANNEL_USER_ID')))
             ->whereIn('channel_users.id',explode(',',redisEnv('PROMOTION_GROUP_CHANNEL_USER_ID')))
-            ->get()
-            ->pluck('id')
-            ->toArray();
+            ->get();
+        \Log::info('$inner_channels:'.json_encode($inner_channels));
+        if(!$inner_channels->isEmpty()){
+            $inner_channels=$inner_channels->pluck('id')->toArray();
+        }else{
+            $inner_channels=[];
+        }
+
         //\Log::info($inner_channels);
         //\Log::info($inner_channels);
         $users = User::where('openid',$openid)->select('id','distribution_channel_id')->get();
         $users = User::where('openid',$openid)->select('id','distribution_channel_id')->get();
         \Log::info('users:openid:'.$openid);
         \Log::info('users:openid:'.$openid);