Update query in getVideoById function in Video class

This commit is contained in:
DariusIII
2018-04-25 14:55:55 +02:00
parent 8e46a08fc0
commit df466da186
2 changed files with 6 additions and 4 deletions
+5 -4
View File
@@ -51,15 +51,16 @@ class Video extends Model
*
*
* @param $id
* @return array
*
* @return \Illuminate\Database\Eloquent\Model|null|static
*/
public static function getByVideoID($id): array
public static function getByVideoID($id)
{
return self::query()
->select(['videos.*', 'tv_info.summary', 'tv_info.publisher', 'tv_info.image'])
->where('videos.id', $id)
->join('tv_info', 'videos.id', '=', 'tv_info.videos_id')
->first(['videos.*', 'tv_info.summary', 'tv_info.publisher', 'tv_info.image'])
->toArray();
->first();
}
/**