弹幕列表

This commit is contained in:
2022-07-12 10:45:20 +08:00
parent cd2ccdec87
commit 94dafde0a4
5 changed files with 59 additions and 2 deletions

View File

@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class VideoDanmakus extends Model
{
protected $table = "video_danmakus";
public function video(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Videos::class, "video_bvid", "bvid");
}
}

View File

@ -15,4 +15,9 @@ class Videos extends Model
{
return $this->hasManyThrough(Programs::class, ProgramVideos::class, "video_bvid", "bvid", "id", "program_id");
}
public function danmakus(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(VideoDanmakus::class, "video_bvid", "bvid");
}
}