|
|
|
@ -15,14 +15,14 @@ class ChannelController extends Controller |
|
|
|
// 所有频道列表
|
|
|
|
public function index() |
|
|
|
{ |
|
|
|
$list = Channel::orderBy('sort')->orderBy('id', 'DESC')->get(['pid', 'name', 'icon']); |
|
|
|
$list = Channel::orderBy('sort')->orderBy('id', 'DESC')->get(['id', 'pid', 'name', 'icon']); |
|
|
|
return $this->success($list); |
|
|
|
} |
|
|
|
|
|
|
|
// 我的频道
|
|
|
|
public function my() |
|
|
|
{ |
|
|
|
$channel_ids = UserChannel::where('uid', $this->user_id)->value('channels'); |
|
|
|
$channel_ids = UserChannel::where('user_id', $this->user_id)->value('channels'); |
|
|
|
$list = Channel::whereIn('id', $channel_ids)->get(['id', 'pid', 'name', 'icon']); |
|
|
|
return $this->success($list); |
|
|
|
} |
|
|
|
|