You've already forked lubo_comment_query
关联关系修正,拆分评论内容,默认进入至节目查询
This commit is contained in:
@ -11,9 +11,14 @@ class Videos extends Model
|
||||
return $this->hasMany(VideoComments::class, "aid", "id");
|
||||
}
|
||||
|
||||
public function program_pivots(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
{
|
||||
return $this->hasMany(ProgramVideos::class, "video_bvid", "bvid");
|
||||
}
|
||||
|
||||
public function programs(): \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
{
|
||||
return $this->hasManyThrough(Programs::class, ProgramVideos::class, "video_bvid", "bvid", "id", "program_id");
|
||||
return $this->hasManyThrough(Programs::class, ProgramVideos::class, "video_bvid", "id", "bvid", "program_id")->orderBy("created_at");
|
||||
}
|
||||
|
||||
public function danmakus(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
|
Reference in New Issue
Block a user