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
25 lines
635 B
<?php
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\UserChannel;
|
|
|
|
class UserChannelController extends Controller
|
|
{
|
|
// 我的频道编辑
|
|
public function update()
|
|
{
|
|
$channels = request()->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();
|
|
}
|
|
}
|