You've already forked lubo_comment_query
弹幕列表
This commit is contained in:
14
app/Models/VideoDanmakus.php
Normal file
14
app/Models/VideoDanmakus.php
Normal 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");
|
||||
}
|
||||
}
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user