You've already forked lubo_comment_query
补充亿点内容,顺便立Flag
This commit is contained in:
28
app/Models/Programs.php
Normal file
28
app/Models/Programs.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Programs extends Model
|
||||
{
|
||||
public function appends(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(ProgramAppends::class, "program_id", "id")->orderByDesc("is_original");
|
||||
}
|
||||
|
||||
public function tags(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Tags::class, ProgramTags::class, "program_id", "id", "id", "tag_id");
|
||||
}
|
||||
|
||||
public function video_pivots(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(ProgramVideos::class, "program_id", "id");
|
||||
}
|
||||
|
||||
public function videos(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Videos::class, ProgramVideos::class, "program_id", "bvid", "id", "video_bvid");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user