海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
635 B

  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Http\Controllers\Controller;
  4. use App\Models\UserChannel;
  5. class UserChannelController extends Controller
  6. {
  7. // 我的频道编辑
  8. public function update()
  9. {
  10. $channels = request()->input('channels');
  11. $channels = json_decode($channels, true);
  12. if (!$channels) {
  13. return $this->error('未选择任何频道');
  14. }
  15. $channels = array_unique(array_filter($channels));
  16. $UserChannel = UserChannel::where('user_id', $this->user_id)->first();
  17. $UserChannel->channels = $channels;
  18. $UserChannel->save();
  19. return $this->success();
  20. }
  21. }