正在显示
2 个修改的文件
包含
11 行增加
和
3 行删除
@@ -39,8 +39,9 @@ class Index extends Base | @@ -39,8 +39,9 @@ class Index extends Base | ||
39 | "banner_list": [{ //轮播图 | 39 | "banner_list": [{ //轮播图 |
40 | "id": 3, //轮播图ID | 40 | "id": 3, //轮播图ID |
41 | "image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址 | 41 | "image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址 |
42 | - "type" : '1', //跳转类型:1=无跳转,2=商品,3=开通会员 | 42 | + "type" : 1, //跳转类型:1=无跳转,2=商品,3=开通会员 |
43 | "goods_id" : 1, //商品ID | 43 | "goods_id" : 1, //商品ID |
44 | + "goods" : //见商品详情数据 | ||
44 | }], | 45 | }], |
45 | "category_list": [{ //一级分类 | 46 | "category_list": [{ //一级分类 |
46 | "id": 1, //分类ID | 47 | "id": 1, //分类ID |
@@ -219,6 +220,12 @@ class Index extends Base | @@ -219,6 +220,12 @@ class Index extends Base | ||
219 | public function index() | 220 | public function index() |
220 | { | 221 | { |
221 | $banner_list = Banner::field('id,image,type,goods_id')->select(); | 222 | $banner_list = Banner::field('id,image,type,goods_id')->select(); |
223 | + foreach ($banner_list as $k => $v){ | ||
224 | + // 查询商品 | ||
225 | + if($v['type'] == '2'){ | ||
226 | + $banner_list[$k]['goods'] = \addons\shopro\model\Goods::getGoodsDetail($v['goods_id']); | ||
227 | + } | ||
228 | + } | ||
222 | $category_list = Category::where('pid',1)->field('id,name,image')->limit(9)->select(); | 229 | $category_list = Category::where('pid',1)->field('id,name,image')->limit(9)->select(); |
223 | $seckill_list = \addons\shopro\model\Goods::indexActivityGoodsList('seckill'); | 230 | $seckill_list = \addons\shopro\model\Goods::indexActivityGoodsList('seckill'); |
224 | $groupon_list = \addons\shopro\model\Goods::indexActivityGoodsList('groupon'); | 231 | $groupon_list = \addons\shopro\model\Goods::indexActivityGoodsList('groupon'); |
@@ -7447,8 +7447,9 @@ | @@ -7447,8 +7447,9 @@ | ||
7447 | "banner_list": [{ //轮播图 | 7447 | "banner_list": [{ //轮播图 |
7448 | "id": 3, //轮播图ID | 7448 | "id": 3, //轮播图ID |
7449 | "image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址 | 7449 | "image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址 |
7450 | - "type" : '1', //跳转类型:1=无跳转,2=商品,3=开通会员 | 7450 | + "type" : 1, //跳转类型:1=无跳转,2=商品,3=开通会员 |
7451 | "goods_id" : 1, //商品ID | 7451 | "goods_id" : 1, //商品ID |
7452 | + "goods" : //见商品详情数据 | ||
7452 | }], | 7453 | }], |
7453 | "category_list": [{ //一级分类 | 7454 | "category_list": [{ //一级分类 |
7454 | "id": 1, //分类ID | 7455 | "id": 1, //分类ID |
@@ -11110,7 +11111,7 @@ | @@ -11110,7 +11111,7 @@ | ||
11110 | 11111 | ||
11111 | <div class="row mt0 footer"> | 11112 | <div class="row mt0 footer"> |
11112 | <div class="col-md-6" align="left"> | 11113 | <div class="col-md-6" align="left"> |
11113 | - Generated on 2021-02-06 16:39:45 </div> | 11114 | + Generated on 2021-02-06 17:08:56 </div> |
11114 | <div class="col-md-6" align="right"> | 11115 | <div class="col-md-6" align="right"> |
11115 | <a href="./" target="_blank">My Website</a> | 11116 | <a href="./" target="_blank">My Website</a> |
11116 | </div> | 11117 | </div> |
-
请 注册 或 登录 后发表评论