diff --git a/app/Http/Controllers/Home/IndexController.php b/app/Http/Controllers/Home/IndexController.php index 7a2fa8d..2b83be7 100644 --- a/app/Http/Controllers/Home/IndexController.php +++ b/app/Http/Controllers/Home/IndexController.php @@ -28,6 +28,7 @@ class IndexController extends BaseController $url = env('APP_API_URL') . "/goods_list"; $res = curl_request($url, $postdata, 'GET'); $data['tjlist'] = $res['data']['list']; +// $data['tjlist'] = []; //列表 @@ -42,7 +43,7 @@ class IndexController extends BaseController } } - $data['article_list'] =collect($res['list'])->toArray(); + $data['article_list'] =$res['list']; $data['article_count'] = intval($res['count']); //banner轮播图 @@ -60,7 +61,7 @@ class IndexController extends BaseController if(!empty($res['list'][$k]->pic)){$res['list'][$k]->pic = http_host().$v->pic;} } } - $data['slide_list'] = collect($res['list'])->toArray(); + $data['slide_list'] = $res['list']; return view('home.index.index', $data); } diff --git a/resources/views/home/index/index.blade.php b/resources/views/home/index/index.blade.php index 1720ec8..17d410c 100644 --- a/resources/views/home/index/index.blade.php +++ b/resources/views/home/index/index.blade.php @@ -29,7 +29,7 @@
$v) { ?> - <?php echo $v['title']; ?> + <?php echo data_get($v, 'title'); ?> @@ -67,7 +67,7 @@ @@ -141,7 +141,7 @@