From 00acb688c5d812b376d5ba7a699775438a20539b Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 24 Aug 2022 19:01:15 +0800 Subject: [PATCH] =?UTF-8?q?VideoParts=E5=BC=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/VideoParts.php | 14 ++++++++++++++ app/Models/Videos.php | 5 +++++ 2 files changed, 19 insertions(+) create mode 100644 app/Models/VideoParts.php diff --git a/app/Models/VideoParts.php b/app/Models/VideoParts.php new file mode 100644 index 0000000..025cd44 --- /dev/null +++ b/app/Models/VideoParts.php @@ -0,0 +1,14 @@ +belongsTo(Videos::class, "bvid", "bvid"); + } +} diff --git a/app/Models/Videos.php b/app/Models/Videos.php index 30220af..575b835 100644 --- a/app/Models/Videos.php +++ b/app/Models/Videos.php @@ -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"); + } }