VideoParts引入
This commit is contained in:
parent
a0e6093a2d
commit
00acb688c5
14
app/Models/VideoParts.php
Normal file
14
app/Models/VideoParts.php
Normal 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");
|
||||
}
|
||||
}
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user