|
@@ -219,7 +219,9 @@ class DreamController extends Controller
|
|
if(count($top3user) <= 2) $top3user[] = $user ;
|
|
if(count($top3user) <= 2) $top3user[] = $user ;
|
|
}
|
|
}
|
|
if ($type == 'paihang') return $this->api($topuser);
|
|
if ($type == 'paihang') return $this->api($topuser);
|
|
- $interactions = InteractionInfo::where('dream_id',$id)->with('comments')->orderBy('id','desc')->get();
|
|
|
|
|
|
+ $interactions = InteractionInfo::where('dream_id',$id)->with(['comments' => function ($query) {
|
|
|
|
+ $query->orderBy('created_at');
|
|
|
|
+ }])->orderBy('id','desc')->get();
|
|
/*dd($interactions);
|
|
/*dd($interactions);
|
|
foreach ($interactions as $item) {
|
|
foreach ($interactions as $item) {
|
|
$item->comments;
|
|
$item->comments;
|
|
@@ -258,7 +260,7 @@ class DreamController extends Controller
|
|
$dream->show_button = $show_button;
|
|
$dream->show_button = $show_button;
|
|
// 梦想互动
|
|
// 梦想互动
|
|
$interactions = InteractionInfo::where('dream_id',$id)->with(['comments' => function ($query) {
|
|
$interactions = InteractionInfo::where('dream_id',$id)->with(['comments' => function ($query) {
|
|
- $query->orderBy('created_at','desc');
|
|
|
|
|
|
+ $query->orderBy('created_at');
|
|
}])->orderBy('created_at','desc')->get();
|
|
}])->orderBy('created_at','desc')->get();
|
|
$dream->interactions = $interactions;
|
|
$dream->interactions = $interactions;
|
|
// dd($interactions);
|
|
// dd($interactions);
|