Browse Source

$channel_ids处理

develop
李可松 4 years ago
parent
commit
e328bab699
  1. 8
      app/Http/Controllers/Api/IndexController.php

8
app/Http/Controllers/Api/IndexController.php

@ -38,9 +38,11 @@ class IndexController extends Controller
# 我的频道
if ($this->user_id) {
$channel_ids = UserChannel::where('user_id', $this->user_id)->value('channels');
$my_channels = Channel::where('agent_id', $this->agent_id)
->whereIn('id', $channel_ids)
->get(['id', 'name', 'icon']);
if ($channel_ids) {
$my_channels = Channel::where('agent_id', $this->agent_id)
->whereIn('id', $channel_ids)
->get(['id', 'name', 'icon']);
}
} else {
$my_channels = Channel::where('agent_id', $this->agent_id)
->where('pid', '<>', 0)

Loading…
Cancel
Save