|
@@ -278,7 +278,15 @@ class EpisodeController extends Controller
|
|
public function detail($id)
|
|
public function detail($id)
|
|
{
|
|
{
|
|
$episodes = Episode::filterPlatform()->withCount(['userWatchRecord','userCollect','userFavorite','lists'])
|
|
$episodes = Episode::filterPlatform()->withCount(['userWatchRecord','userCollect','userFavorite','lists'])
|
|
- ->with(['category:id,name','lists:id,episodes_id,sort,url,is_free,origin_price,sale_price'])
|
|
|
|
|
|
+ ->with([
|
|
|
|
+ 'category:id,name',
|
|
|
|
+ 'lists'=> function($query){
|
|
|
|
+ $query->select([
|
|
|
|
+ 'id','episodes_id','sort','url','is_free','origin_price','sale_price'
|
|
|
|
+ ])
|
|
|
|
+ ->orderBy('sort');
|
|
|
|
+ }
|
|
|
|
+ ])
|
|
->where('is_opend', 1)
|
|
->where('is_opend', 1)
|
|
->where('id', $id)
|
|
->where('id', $id)
|
|
->first();
|
|
->first();
|