From fef7f480d66272246f7ee5f22b7fb71615b044d1 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 21 Jul 2021 10:33:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ChannelController?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/ChannelController.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 app/Http/Controllers/Api/ChannelController.php diff --git a/app/Http/Controllers/Api/ChannelController.php b/app/Http/Controllers/Api/ChannelController.php new file mode 100644 index 0000000..1e0a11f --- /dev/null +++ b/app/Http/Controllers/Api/ChannelController.php @@ -0,0 +1,29 @@ +orderBy('id', 'DESC')->get(['pid', 'name', 'icon']); + return $this->success($list); + } + + // 我的频道 + public function my() + { + $channel_ids = UserChannel::where('uid', $this->user_id)->value('channels'); + $list = Channel::whereIn('id', $channel_ids)->get(['id', 'pid', 'name', 'icon']); + return $this->success($list); + } +}