# 首页版块
表结构
```
<pre class="calibre14">```
CREATE TABLE `yf_front_forum` <span class="token1">(</span>
`forum_id` <span class="token3">int</span><span class="token1">(</span><span class="token6">10</span><span class="token1">)</span> NOT NULL AUTO_INCREMENT<span class="token1">,</span>
`forum_name` <span class="token3">varchar</span><span class="token1">(</span><span class="token6">255</span><span class="token1">)</span> NOT NULL COMMENT <span class="token4">'板块名称'</span><span class="token1">,</span>
`forum_order` <span class="token3">int</span><span class="token1">(</span><span class="token6">10</span><span class="token1">)</span> NOT NULL COMMENT <span class="token4">'首页板块顺序'</span><span class="token1">,</span>
`forum_state` <span class="token3">tinyint</span><span class="token1">(</span><span class="token6">1</span><span class="token1">)</span> NOT NULL DEFAULT <span class="token6">1</span> COMMENT <span class="token4">'状态1开启2关闭'</span><span class="token1">,</span>
`forum_content` <span class="token3">varchar</span><span class="token1">(</span><span class="token6">255</span><span class="token1">)</span> NOT NULL COMMENT <span class="token4">'板块内容'</span><span class="token1">,</span>
`forum_style` <span class="token3">int</span><span class="token1">(</span><span class="token6">10</span><span class="token1">)</span> NOT NULL DEFAULT <span class="token6">1</span> COMMENT <span class="token4">'1-长方形 2-正方形'</span><span class="token1">,</span>
PRIMARY KEY <span class="token1">(</span>`forum_id`<span class="token1">)</span>
<span class="token1">)</span> ENGINE<span class="token">=</span>InnoDB AUTO_INCREMENT<span class="token">=</span><span class="token6">1</span> DEFAULT CHARSET<span class="token">=</span>utf8 ROW_FORMAT<span class="token">=</span>COMPACT COMMENT<span class="token">=</span><span class="token4">'首页板块设置表'</span><span class="token1">;</span>
```
```
1.获取版块列表
```
<pre class="calibre14">```
get:/index.php?crl=Api_Forum&met=front&typ=json
<<<
success
{"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"page":1,
"total":1,
"totalsize":"3",
"records":"3",
"items":[
{"forum_id":"1", //版块id
"forum_name":"店铺代金券", //版块名称
"forum_order":"1", //版块排序
"forum_state":"1", /版块状态 1-开启 2-关闭
"forum_content":[
{"title":"店铺代金券", //版块活动名称
"type":"voucher", //版块活动类型
"content":["242","241","240","235"] //版块活动内容
}],
"forum_style":"1", //版块样式 1-长方形 2-正方形
"id":"1"
},
{"forum_id":"6",
"forum_name":"平台红包",
"forum_order":"2",
"forum_state":"2",
"forum_content":[
{"title":"平台红包",
"type":"redpacket",
"content":["149","114","30","25"]
}],
"forum_style":"1",
"id":"6"},
{"forum_id":"4",
"forum_name":"测试2",
"forum_order":"3",
"forum_state":"2",
"forum_content":[
{"title":"团",
"type":"grouptype",
"content":["293","228","171","141"]
},
{"title":"限时折扣",
"type":"discount",
"content":["297","298","299"]
}],
"forum_style":"2",
"id":"4"
}
]
}
}
<<<
error
```
```
2.获取版块内容
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Forum&met=getForumContent&typ=json
*string:id=默认值#版块id
<<<
success
{"cmd_id":-140,
"status":200,
"msg":"success",
"data":{
"forum_id":"11", //版块id
"forum_name":"团购", //版块名称
"forum_order":"7", //版块排序
"forum_state":"1", //版块状态 1-开启 2-关闭
"forum_content":[ //版块内容
{"title":"团购", //版块活动名称
"type":"groupbuy", //版块活动类型
"content":["293","228","171","141","235","304","149"], //版块活动内容 -- 此处为团购
"content_info":[ //版块活动内容详情 -- 此处为团购信息
{"groupbuy_image_rec":"http:\/\/shop.local.yuanfeng021.com\/image.php\/shop\/data\/upload\/media\/d3aabd05be45670d48e2685d1e1f5992\/10104\/51\/image\/20171024\/1508809291346874.jpg!612x318.jpg", //团购图片
"groupbuy_name":"tz虚拟团", //团购名称
"groupbuy_endtime":"2018-10-24 10:00:00", //团购结束时间
"groupbuy_starttime":"2017-10-24 10:00:00", //团购开始时间
"groupbuy_buyer_count":"12", //已团人数
"goods_price":"450.00" //团购价 },
{"groupbuy_image_rec":"https:\/\/shop.local.yuanfeng021.com\/image.php\/shop\/data\/upload\/media\/d3aabd05be45670d48e2685d1e1f5992\/10104\/51\/image\/20171208\/1512725526425266.jpg!612x318.jpg",
"groupbuy_name":"tttttttt",
"groupbuy_endtime":"2018-11-09 23:00:00",
"groupbuy_starttime":"2017-12-08 18:00:00",
"groupbuy_buyer_count":"4",
"goods_price":"50.00"},
{"groupbuy_image_rec":"https:\/\/shop.local.yuanfeng021.com\/image.php\/shop\/data\/upload\/media\/d3aabd05be45670d48e2685d1e1f5992\/10104\/51\/image\/20180329\/1522303533136936.jpg!612x318.jpg",
"groupbuy_name":"团购团购",
"groupbuy_endtime":"2018-09-15 18:00:00",
"groupbuy_starttime":"2018-03-29 15:00:00",
"groupbuy_buyer_count":"29",
"goods_price":"90.00"},
{"groupbuy_image_rec":"http:\/\/upload.local.yuanfeng021.com\/image.php\/media\/d3aabd05be45670d48e2685d1e1f5992\/10295\/82\/image\/20180823\/1534991492934718.jpg!612x318.jpg",
"groupbuy_name":"供应商也可以发团购?",
"groupbuy_endtime":"2018-09-19 16:00:00",
"groupbuy_starttime":"2018-08-23 11:00:00",
"groupbuy_buyer_count":"0",
"goods_price":"12.00"}
]
}],
"forum_style":"1",
"id":"11"
}
}
<<<
error
```
```
3.修改版块内容
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Forum&met=editForum&typ=json
*string:id#版块id
row:forum_connect#版块内容
int:edit_content#修改哪块版块内容 1-左 2-右
forum_name#版块名称
int:forum_state#是否启用
int:forum_style#版块样式
<<<
success
{"cmd_id":-140,"status":200,"msg":"success","data":{}}
<<<
error
{"cmd_id":-140,"status":250,"msg":"failure","data":{}}
```
```
```
<pre class="calibre14">```
当edit_content <span class="token">=</span> <span class="token6">1</span> 时,edit_econtent需要传递键值为<span class="token6">0</span>的数组
$edit_econtent<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'title'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'团购'</span><span class="token1">;</span>
$edit_econtent<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'type'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'groupbuy'</span><span class="token1">;</span>
$edit_econtent<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'content'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'293'</span><span class="token1">,</span><span class="token4">'228'</span><span class="token1">)</span><span class="token1">;</span>
当edit_content <span class="token">=</span> <span class="token6">2</span> 时,edit_econtent需要传递键值为<span class="token6">1</span>的数组
$edit_econtent<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'title'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'团购'</span><span class="token1">;</span>
$edit_econtent<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'type'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'groupbuy'</span><span class="token1">;</span>
$edit_econtent<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'content'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'293'</span><span class="token1">,</span><span class="token4">'228'</span><span class="token1">)</span><span class="token1">;</span>
```
```
4.修改板块顺序
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Forum&met=setForumOrder&typ=json
row:order_forum1#修改的对应板块
row:order_forum2#修改的对应板块
<<<
success
{"cmd_id":-140,"status":200,"msg":"success","data":{}}
<<<
error
{"cmd_id":-140,"status":250,"msg":"failure","data":{}}
```
```
5.添加版块内容
```
<pre class="calibre14">```
get:/index.php?ctl=Api_Forum&met=addFrontForum&typ=json
forum_name#版块名称
int:forum_order#版块排序
row:forum_content#版块内容
int:forum_style=1#版块样式 1-长方形 2-正方形
<<<
success
{"cmd_id":-140,"status":200,"msg":"添加成功","data":{}}
<<<
error
{"cmd_id":-140,"status":250,"msg":"最多添加9款商品","data":{}}
```
```
```
<pre class="calibre14">```
版块内容说明:
当forum_style<span class="token">=</span><span class="token6">1</span>时,表明版块中只有一个活动,forum_content中只有一个活动参数,举例如下:
$updata <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
$updata<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'title'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'团购'</span><span class="token1">;</span> <span class="token5">//活动名称</span>
$updata<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'type'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'grouptype'</span><span class="token1">;</span> <span class="token5">//活动类型 </span>
$updata<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'content'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'293'</span><span class="token1">,</span><span class="token4">'228'</span><span class="token1">,</span><span class="token4">'171'</span><span class="token1">,</span><span class="token4">'141'</span><span class="token1">)</span><span class="token1">;</span> <span class="token5">//活动内容 -- 此处为团购商品</span>
forum_content<span class="token">=</span> $updata<span class="token1">;</span>
当forum_style<span class="token">=</span><span class="token6">2</span>时,表明版块中有两个活动,forum_content中有两个活动参数,举例如下:
$updata <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
$updata<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'title'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'团购'</span><span class="token1">;</span> <span class="token5">//活动名称</span>
$updata<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'type'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'grouptype'</span><span class="token1">;</span> <span class="token5">//活动类型 </span>
$updata<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'content'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'293'</span><span class="token1">,</span><span class="token4">'228'</span><span class="token1">,</span><span class="token4">'171'</span><span class="token1">,</span><span class="token4">'141'</span><span class="token1">)</span><span class="token1">;</span> <span class="token5">//活动内容 -- 此处为团购商品</span>
$updata<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'title'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'显示折扣'</span><span class="token1">;</span>
$updata<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'type'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">'discount'</span><span class="token1">;</span>
$updata<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'content'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'297'</span><span class="token1">,</span><span class="token4">'298'</span><span class="token1">,</span><span class="token4">'299'</span><span class="token1">)</span><span class="token1">;</span> <span class="token5">//活动内容 -- 此处为显示折扣商品</span>
forum_content<span class="token">=</span> $updata<span class="token1">;</span>
```
```
6.删除首页版块
```
<pre class="calibre15">```
get:/index.php?ctl=Api_Forum&met=editForum&typ=json
*string:id=默认值#说明文字
name#说明文字
<<<
success
{"cmd_id":-140,"status":200,"msg":"success","data":{}}
<<<
error
{"cmd_id":-140,"status":250,"msg":"failure","data":{}}
```
```
- 序言
- 系统要求
- 版本更新日志
- 远丰商城技术对接说明
- 开发指导
- 框架内容
- 基础
- 开发规范
- 目录结构
- 架构
- 架构总览
- 数据库
- 数据库连接
- 基本使用
- 缓存
- 配置
- 路由
- 数据字典
- ucenter
- shop
- paycenter
- ucenter_admin
- shop_admin
- paycenter_admin
- 通讯内容
- 商家中心
- 顶部导航栏
- 店铺信息栏
- 店铺及商品提示栏
- 交易提示栏
- 销售情况统计栏
- 单品销量排行栏
- 店铺运营推广栏
- 平台联系方式栏
- 订单物流
- 商品
- 商品列表
- 商品详情
- 商品发布与编辑
- 分销商品
- 关联版式
- 商品规格
- 图片空间
- 淘宝导入
- 订单流程
- 交易订单
- 订单退款/退货
- 促销
- 团购管理
- 加价购
- 限时折扣
- 满即送
- 代金券管理
- 分销
- 店铺
- 店铺设置
- 自销产品供应商
- 实体店铺
- 品牌申请
- 店铺信息
- 消费者保障服务
- 门店账号
- 分销商--产品供应商
- 分销明细
- 批发市场
- 售后服务
- 咨询管理
- 投诉管理
- 退款管理
- 退货管理
- 云方案架构
- 负载集群
- 云存储
- 接口
- Api接口说明
- 品牌
- 商品规格
- 商品类型
- 商品分类
- 商品
- 订单
- 商品/店铺收藏
- 足迹
- 退款及退货
- 商家店铺
- 会员
- 入驻协议
- 订单接口
- 商品接口
- 订单物流接口
- 商家中心接口
- 促销接口
- 快递鸟物流接口
- 代金券接口
- 首页版块
- 团购
- 平台红包
- 限时折扣接口
- 拼团接口
- wap首页模板
- 杂项
- 远程上传图片
- JS
- 银联支付
- 多语言
- 商品评分
- 图片加载
- 买家申请退款退货
- 商家退款退货
- 平台退款退货
- 添加发票
- 提交订单
- 确认订单
- 运费销售区域
- 获取会员地址
- 充值
- 导出XLS
- 商城系统集成
- 多语言实现
- 三级分销推广链接发展推广员
- app.ini.php
- 去分销
- 版本更新
- 物流支持
- 运营人员建议
- 业务逻辑
- 统计结算
- 客服消息
- 账号
- 三级分销
- IM
- 配置
- 平台帐号
- 活动数据表说明