parent
commit
932e422063
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      app/Http/Controllers/Api/HomePageController.php

+ 2
- 1
app/Http/Controllers/Api/HomePageController.php View File

28
     {
28
     {
29
         $locale = $locale == "tw" ? "zh_TW" : $locale;
29
         $locale = $locale == "tw" ? "zh_TW" : $locale;
30
         $result = [];
30
         $result = [];
31
-        $banners = Banner::where("visible", true)->get()->map(function ($record) use ($result, $locale){
31
+        $banners = Banner::where("visible", true)->get()->map(function ($record) use (&$result, $locale){
32
             $result[] = [
32
             $result[] = [
33
                 "imgUrl" => $record->imgUrlLink,
33
                 "imgUrl" => $record->imgUrlLink,
34
                 "mobileImgUrl" => $record->mobileImgLink,
34
                 "mobileImgUrl" => $record->mobileImgLink,
36
                 "content" => $record->getTranslation("content", $locale),
36
                 "content" => $record->getTranslation("content", $locale),
37
             ];
37
             ];
38
         });
38
         });
39
+        return Response::ok($result);
39
     }
40
     }
40
 
41
 
41
     public function list($locale = 'tw')
42
     public function list($locale = 'tw')