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); + } +}