Browse Source

advertise

tusx 6 năm trước cách đây
mục cha
commit
d00dbc19b9
1 tập tin đã thay đổi với 4 bổ sung10 xóa
  1. 4 10
      app/Http/Controllers/Wap/User/CoflController.php

+ 4 - 10
app/Http/Controllers/Wap/User/CoflController.php

@@ -304,7 +304,7 @@ class CoflController extends Controller
     private function getUsersV2($openid,$bid){
         $friend_link_uid_bind = DB::table('friend_link_uid_bind')->where('openid',$openid)->where('bid',$bid)->first();
         if($friend_link_uid_bind) {
-            $user = User::where('id',$friend_link_uid_bind->uid)->select('id','distribution_channel_id')->get();
+            $user = User::where('id',$friend_link_uid_bind->uid)->select('id','distribution_channel_id')->first();
             if($user) {
                 return [$user->id,$user->distribution_channel_id];
             }
@@ -312,15 +312,9 @@ class CoflController extends Controller
         $inner_channels = Channel::join('channel_users','channel_users.id','=','distribution_channels.channel_user_id')
             ->select('distribution_channels.id')
             ->whereIn('channel_users.id',explode(',',redisEnv('PROMOTION_GROUP_CHANNEL_USER_ID')))
-            ->get();
-        \Log::info('channel:'.(redisEnv('PROMOTION_GROUP_CHANNEL_USER_ID')));
-        \Log::info('$inner_channels:'.json_encode($inner_channels));
-        if(!$inner_channels->isEmpty()){
-
-            $inner_channels=$inner_channels->pluck('id')->toArray();
-        }else{
-            $inner_channels=[];
-        }
+            ->get()
+            ->pluck('id')
+            ->toArray();
 
         //\Log::info($inner_channels);
         $users = User::where('openid',$openid)->select('id','distribution_channel_id')->get();