VideoParts引入

This commit is contained in:
Jerry Yan 2022-08-24 19:01:15 +08:00
parent a0e6093a2d
commit 00acb688c5
Signed by: q792602257
GPG Key ID: D070F653AF6C0004
2 changed files with 19 additions and 0 deletions

14
app/Models/VideoParts.php Normal file
View File

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

View File

@ -41,4 +41,9 @@ class Videos extends Model
{
return $this->danmakus()->where("platform_id", "=", 3);
}
public function parts(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(VideoParts::class, "bvid", "bvid");
}
}