Browse Source

'新增手机号查询'

zhuchengjie 2 years ago
parent
commit
5f6d03f5f4
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/Controllers/CompanyAuth/AppController.php

+ 11 - 1
src/Controllers/CompanyAuth/AppController.php

@@ -149,8 +149,18 @@ class AppController extends Controller
      *       ]
      *   }
      */
-    public function officialAccounts()
+    public function officialAccounts(Request $request)
     {
+        $phone = $request->get('phone', '');
+        $is_enable = $request->get('is_enabled', '');
+        if(!empty($phone)) {
+            $channel = new ChannelService();
+            $distribution_channels = $channel->getChannelsByChannelUserIds([],$is_enable,$phone);
+            if(!$distribution_channels->isEmpty()){
+                $distribution_channels = $distribution_channels->toArray();
+                $this->channel_ids = array_column($distribution_channels,'id');
+            }
+        }
         $service = new OfficialAccountService;
         $result = collectionTransform(new OfficialAccountTransformer, $service->getOfficialAccountsByChannelIds($this->channel_ids));
         return response()->success($result);