input('channels'); $channels = json_decode($channels, true); if (!$channels) { return $this->error('未选择任何频道'); } $channels = array_unique(array_filter($channels)); $UserChannel = UserChannel::where('user_id', $this->user_id)->first(); $UserChannel->channels = $channels; $UserChannel->save(); return $this->success(); } }