ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## Archives.php 此控制器负责CMS小程序端文章数据列表的展示和详情展示,主要分为以下几个请求方法 ## index - 文档列表 此方法主要负责CMS小程序文章数据列表的数据提供。 ### 请求方法 POST ### 请求参数 | 参数名 | 描述 | 说明 | 必选 | | --- | --- | --- | --- | | model | 模型ID | 主要用于CMS小程序端新闻和产品的区分 | 是 | | channel | 分类ID | 主要用于列表分类的筛选 | 否 | | page | 分页ID | 主要用于CMS小程序端新闻列表分页数据的加载 | 否 | ### 返回值 ~~~json { "code": 1, "msg": "", "time": "1574045752", "data": { //文档列表 "archivesList": [ { "id": 16, "user_id": 1, "channel_id": 4, "model_id": 1, "special_id": 0, "title": "文档标题", "style": "", "flag": "", "image": "https://cdn.fastadmin.net/uploads/2018/20180416/5ad4411db71750.png", "keywords": "", "description": "描述内容", "tags": "互联网,安全", "views": 6792, "comments": 0, "likes": 70, "dislikes": 0, "diyname": "", "createtime": 1523721095, "updatetime": 1523878887, "publishtime": 1523635200, "hasimage": true, //文档栏目信息 "channel": { "id": 4, "name": "安全", "image": "http://www.yoursite.com/assets/addons/cms/img/noimage.jpg", "diyname": "security", "items": 5 }, "likeratio": 100, "create_date": "1年前" } ] } } ~~~ ## detail - 文档详情 此方法主要负责CMS小程序文章数据详情的数据提供。 ### 请求参数 | 参数名 | 描述 | 说明 | 必选 | | --- | --- | --- | --- | | id | 文档ID | 主要用于筛选指定文档的详情 | 是 | | diyname | 自定义名称 | 主要用于通过自定义名称筛选文档的数据 | 否 | ### 返回值 ~~~json { "code": 1, "msg": "", "time": "1574046108", "data": { //文档详情 "archivesInfo": { "id": 14, "user_id": 1, "channel_id": 4, "model_id": 1, "special_id": 0, "title": "文档标题", "style": "", "flag": "", "image": "https:\/\/cdn.fastadmin.net\/uploads\/20180416\/5ad4411e749b30.jpg", "keywords": "文档关键字", "description": "文档描述", "tags": "安全", "weigh": 0, "views": 6376, "comments": 0, "likes": 227, "dislikes": 0, "diyname": "", "createtime": 1523720913, "updatetime": 1523878935, "publishtime": 1523635200, "deletetime": null, "memo": "", "status": "normal", "content": "文档详情内容", "author": "", "price": "0.00", "likeratio": 100, "tagslist": [{ "name": "安全", "url": "\/cms\/t\/安全.html" }], "create_date": "1年前" }, //文档栏目信息 "channelInfo": { "id": 4, "type": "list", "model_id": 1, "name": "安全", "image": "http:\/\/www.yoursite.com\/assets\/addons\/cms\/img\/noimage.jpg", "flag": "recommend", "keywords": "", "description": "", "diyname": "security", "outlink": "", "items": 5, "pagesize": 10, "iscontribute": 1, "isnav": 1, "createtime": 1508990707, "updatetime": 1553416184, }, //评论信息 "commentList": [{ "id": 3, "user_id": 1, "type": "archives", "aid": 34, "pid": 0, "content": "完全赞同这样的说法,欢迎提供你的意见或建议。", "comments": 0, "ip": "127.0.0.1", "useragent": "UserAgent", "subscribe": 1, "createtime": 1553763331, "updatetime": 1553763331, "status": "normal", "user": { "id": 1, "nickname": "admin", "avatar": "头像链接", "email": "admin@163.com", "url": "\/u\/1" }, "create_date": "7月前" }] } } ~~~ ## vote - 赞与踩 此方法主要负责CMS小程序文章赞与踩的API接口。 ### 请求参数 | 参数名 | 描述 | 说明 | 必选 | | --- | --- | --- | --- | | id | 文档ID | 文档ID | 是 | | type | 投票类型 | like或dislike | 是 | ### 返回值 ~~~css { "code": 1, "msg": "", "time": "1574046108", "data": { "likes": "1", "dislikes": "0", "likeratio": "100", } } ~~~ ## order - 付费订单提交 此方法主要负责CMS小程序文章数据详情的数据提供。 ### 请求参数 | 参数名 | 描述 | 说明 | 必选 | | --- | --- | --- | --- | | id | 文档ID | 文档ID | 是 | ### 返回值 ~~~css { "code": 1, "msg": "", "time": "1574046108", "data": { "return_ code": "SUCCESS", "return_ msg": "OK" "appid":"5", "mch_ id":"1434511111", "device_ info": "1000", "nonce_ str":"a17lr7u47sFfZlnZ", "sign":"37A96FE5DB50CF32419549144A10F2D7", "result_code":"SUCCESS", "prepay_ id": "wx2019111814224218dc7b5ce20844101928", "trade_ type": "JSAPI" } } ~~~