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:
nepiedg
2026-04-03 03:48:25 +00:00
parent 5a9d6090f3
commit be58aac7e7
5 changed files with 778 additions and 0 deletions
+24
View File
@@ -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();
}
}