From 320e2d6441637042547a180b8d18dc05d41f9308 Mon Sep 17 00:00:00 2001 From: bill <276957690@qq.com> Date: Tue, 2 Nov 2021 17:35:06 +0800 Subject: [PATCH] 4 --- app/Http/Controllers/Home/IndexController.php | 5 +++-- resources/views/home/index/index.blade.php | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) 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 @@