feat(video): add user-specific video query and filter accounts functionality
- Introduced `buildUserQuery` method in `DysVideoLog` model to create a base query for user-specific video logs. - Added `getVideoFilterAccountsByUserId` method in `DyVideoUser` model to retrieve active accounts for a specified user. - Updated routing to include new video work API endpoints under `v1/video-work`, requiring user authentication.
This commit is contained in:
@@ -78,4 +78,28 @@ class DyVideoUser extends Model
|
||||
|
||||
return $query->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取视频作品页筛选用的账号列表。
|
||||
*
|
||||
* 对齐 acgpmw `video_info::video_list()`:
|
||||
* - 仅返回当前用户启用中的账号
|
||||
* - 返回平台与昵称,供前端拼出“平台(昵称)#Pid”样式
|
||||
*
|
||||
* @param int $userid 用户ID
|
||||
* @return Collection
|
||||
*/
|
||||
public static function getVideoFilterAccountsByUserId(int $userid): Collection
|
||||
{
|
||||
return self::where('userid', $userid)
|
||||
->where('disabled', 0)
|
||||
->order(['id' => 'desc'])
|
||||
->field([
|
||||
'id',
|
||||
'platform',
|
||||
'dy_nickname',
|
||||
'dy_avatar',
|
||||
])
|
||||
->select();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user