作者 何书鹏

轮播图商品

... ... @@ -39,8 +39,9 @@ class Index extends Base
"banner_list": [{ //轮播图
"id": 3, //轮播图ID
"image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址
"type" : '1', //跳转类型:1=无跳转,2=商品,3=开通会员
"type" : 1, //跳转类型:1=无跳转,2=商品,3=开通会员
"goods_id" : 1, //商品ID
"goods" : //见商品详情数据
}],
"category_list": [{ //一级分类
"id": 1, //分类ID
... ... @@ -219,6 +220,12 @@ class Index extends Base
public function index()
{
$banner_list = Banner::field('id,image,type,goods_id')->select();
foreach ($banner_list as $k => $v){
// 查询商品
if($v['type'] == '2'){
$banner_list[$k]['goods'] = \addons\shopro\model\Goods::getGoodsDetail($v['goods_id']);
}
}
$category_list = Category::where('pid',1)->field('id,name,image')->limit(9)->select();
$seckill_list = \addons\shopro\model\Goods::indexActivityGoodsList('seckill');
$groupon_list = \addons\shopro\model\Goods::indexActivityGoodsList('groupon');
... ...
... ... @@ -7447,8 +7447,9 @@
"banner_list": [{ //轮播图
"id": 3, //轮播图ID
"image": "http://www.ant.top/uploads/20201214/b655ea4dc4779222ab7a4e2b95feb3a4.png" //图片地址
"type" : '1', //跳转类型:1=无跳转,2=商品,3=开通会员
"type" : 1, //跳转类型:1=无跳转,2=商品,3=开通会员
"goods_id" : 1, //商品ID
"goods" : //见商品详情数据
}],
"category_list": [{ //一级分类
"id": 1, //分类ID
... ... @@ -11110,7 +11111,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2021-02-06 16:39:45 </div>
Generated on 2021-02-06 17:08:56 </div>
<div class="col-md-6" align="right">
<a href="./" target="_blank">My Website</a>
</div>
... ...