lh 3 anni fa
parent
commit
e2fbf508c4
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      src/Services/Channel/ChannelService.php

+ 4 - 2
src/Services/Channel/ChannelService.php

@@ -24,11 +24,13 @@ class ChannelService
         if ($phone || $phone !== '') {
             $channel_user_id = DB::connection('mysql')->table('channel_users')->where(['phone'=>$phone])->pluck('id')->all();
             \Log::info('channel_user_id: '.json_encode($channel_user_id, 256));
-            $where['phone'] = $phone;
+            if ($channel_user_id) {
+                $channel_user_ids = array_merge($channel_user_ids, $channel_user_id);
+                \Log::info('channel_user_id: '.json_encode($channel_user_id, 256));
+            }
         }
 
         if ($where) {
-
             return Channel::whereIn('channel_user_id', $channel_user_ids)->where($where)->get();
         }
         return Channel::whereIn('channel_user_id', $channel_user_ids)->get();