下面羊死了 发表于 2022-9-21 17:32:19

json多层解析


{
    "result": [{
      "avatar": null,
      "channelName": null,
      "commentNumber": null,
      "content": null,
      "createAt": "2022-09-19 15:02",
      "creator": "主理人说:",
      "dynamicId": 143519,
      "pid": 0,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "仅供参考!",
      "createAt": "2022-09-19 14:38",
      "creator": "主理人说: ",
      "dynamicId": 143498,
      "needRelocateReason": false,
      "pid": 242228972,
      "relocateList": [{
            "code": "000***",
            "currentRatio": 0.0000,
            "finalPrice": 0.0000,
            "name": "****",
            "newRatio": 0.1000,
            "state": -1,
            "type": 1
      }],
      "state": -1,
      "type": 1,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "#不做参考!",
      "createAt": "2022-09-19 13:14",
      "creator": "主理人说:",
      "dynamicId": 143432,
      "pid": 242201103,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "#北参考!",
      "createAt": "2022-09-19 13:08",
      "creator": "主理人说:",
      "dynamicId": 143429,
      "pid": 242199484,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "#21观点仅供参考!",
      "createAt": "2022-09-19 10:35",
      "creator": "主理人说:",
      "dynamicId": 143378,
      "pid": 242148913,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "#最新统计汽车零部件",
      "createAt": "2022-09-19 09:58",
      "creator": "主理人说:",
      "dynamicId": 143327,
      "pid": 242132480,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "仅供参考!",
      "createAt": "2022-09-19 09:58",
      "creator": "主理人说: ",
      "dynamicId": 143326,
      "needRelocateReason": false,
      "pid": 242132641,
      "relocateList": [{
            "code": "002***",
            "currentRatio": 0.1687,
            "finalPrice": 5.1000,
            "name": "****",
            "newRatio": 0.0000,
            "state": 1,
            "type": 1
      }],
      "state": 1,
      "type": 1,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "#最新统计!汽车零部件",
      "createAt": "2022-09-19 09:57",
      "creator": "主理人说:",
      "dynamicId": 143325,
      "pid": 242132329,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "#排名#<br/><br/>1,仅供参考!<br/>",
      "createAt": "2022-09-19 09:57",
      "creator": "主理人说:",
      "dynamicId": 143324,
      "pid": 242132075,
      "type": 2,
      "userId": null,
      "valid": 1
    }, {
      "avatar": null,
      "channelName": null,
      "commentNumber": 0,
      "content": "周五仅供参考!",
      "createAt": "2022-09-18 21:09",
      "creator": "主理人说:",
      "dynamicId": 143240,
      "pid": 242083484,
      "type": 2,
      "userId": null,
      "valid": 1
    }],
    "errorCode": 0,
    "errorMsg": "Success"
}

新手求助,表格表头分别为(“日期”“内容””编号”),result 中的 createAt (日期)和 content(内容)添加进表格同一行中,另外如result.relocateList.code(编号)有数值的话也添加到同一行中,但是如果有result.relocateList.code或更多时,就每个值添加进新一行中,而且日期和内容留空即可。。。。。。。怎么易语言和E4A差别这么大{:4_88:}

低调小鱼鱼 发表于 2022-9-21 17:32:20

直接看附件源码,注意你的json格式一定要正确

下面羊死了 发表于 2022-9-22 08:14:03

低调小鱼鱼 发表于 2022-9-21 17:32
直接看附件源码,注意你的json格式一定要正确

兄弟,你源码和我说的有点差别啊

zh2650307 发表于 2022-9-22 20:45:32

简单的很。。。。。。。。。。。。。。

下面羊死了 发表于 2022-9-26 11:59:54

zh2650307 发表于 2022-9-22 20:45
简单的很。。。。。。。。。。。。。。

确实很简单,学习了一下例程知道怎么写了

yuehun 发表于 2022-11-5 21:33:13

11111111111

201888 发表于 2022-11-10 12:04:26

坛有你更精彩~

whoseboys 发表于 2022-11-12 12:41:19

谢谢分享

a2992035903 发表于 2024-8-19 06:18:52

一层一层去分析他的数据
页: [1]
查看完整版本: json多层解析